mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
#975 ISA_NGRX_STATE exceeded the quota
This commit is contained in:
@@ -62,4 +62,6 @@ export const patchCommentDone = createAction(
|
||||
props<{ response: StrictHttpResponse<ResponseArgsOfOrderItemSubsetDTO> }>()
|
||||
);
|
||||
|
||||
export const cleanup = createAction(`${prefix} Cleanup`);
|
||||
|
||||
export const setComment = createAction(`${prefix} Set Comment`, props<{ orderItemSubsetId: number; comment: string }>());
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Actions, ofType, createEffect } from '@ngrx/effects';
|
||||
import { Actions, ofType, createEffect, ROOT_EFFECTS_INIT, OnInitEffects } from '@ngrx/effects';
|
||||
|
||||
import * as actions from './details.actions';
|
||||
import { flatMap, catchError, map } from 'rxjs/operators';
|
||||
import { flatMap, catchError, map, debounceTime, throttleTime } from 'rxjs/operators';
|
||||
import { OrderService, StrictHttpResponse, ListResponseArgsOfOrderItemListItemDTO, AbholfachService } from '@swagger/oms';
|
||||
import { of, NEVER } from 'rxjs';
|
||||
import { of, NEVER, interval } from 'rxjs';
|
||||
import { SearchStateFacade } from '../search';
|
||||
|
||||
@Injectable()
|
||||
export class DetailsEffects {
|
||||
export class DetailsEffects implements OnInitEffects {
|
||||
constructor(
|
||||
private actions$: Actions,
|
||||
private abholfachService: AbholfachService,
|
||||
@@ -135,4 +135,8 @@ export class DetailsEffects {
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
ngrxOnInitEffects() {
|
||||
return actions.cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,10 @@ const _detailsReducer = createReducer(
|
||||
a.orderItems.map((item) => item.orderItemSubsetId),
|
||||
s
|
||||
);
|
||||
return detailsStateEntityAdapter.addMany(a.orderItems, next);
|
||||
return detailsStateEntityAdapter.addMany(
|
||||
a.orderItems.map((items) => ({ ...items, timestamp: Date.now() })),
|
||||
next
|
||||
);
|
||||
}
|
||||
|
||||
return s;
|
||||
@@ -21,7 +24,8 @@ const _detailsReducer = createReducer(
|
||||
return detailsStateEntityAdapter.updateOne({ id: a.orderItemSubsetId, changes: { specialComment: a.comment } }, s);
|
||||
}
|
||||
return s;
|
||||
})
|
||||
}),
|
||||
on(actions.cleanup, (s) => detailsStateEntityAdapter.removeAll(s))
|
||||
);
|
||||
|
||||
export function detailsReducer(state: DetailsState, action: Action) {
|
||||
|
||||
Reference in New Issue
Block a user