TSK-1214: Removed unneccessary copies and GET call
This commit is contained in:
parent
7b5927d281
commit
dbdf3e6b03
|
@ -242,7 +242,6 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
|
|||
return `custom${customNumber}`;
|
||||
}
|
||||
|
||||
// TODO: Remove when classification is in store
|
||||
getAvailableCategories(type: string) {
|
||||
let returnCategories: string[] = [];
|
||||
this.classificationTypes$.pipe(take(1)).subscribe(classTypes => {
|
||||
|
|
|
@ -83,7 +83,7 @@ export class ClassificationState implements NgxsAfterBootstrap {
|
|||
classification.children = !classification.children ? [] : classification.children;
|
||||
});
|
||||
ctx.patchState({
|
||||
classifications: [...classifications]
|
||||
classifications
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
@ -159,16 +159,9 @@ export class ClassificationState implements NgxsAfterBootstrap {
|
|||
|
||||
@Action(UpdateClassification)
|
||||
updateClassification(ctx: StateContext<ClassificationStateModel>, action: SaveClassification): Observable<any> {
|
||||
return this.classificationsService.putClassification(action.classification).pipe(
|
||||
// TODO remove this call when backend is fixed modified dates are not same
|
||||
take(1), tap(() => this.classificationsService.getClassifications(ctx.getState().selectedClassificationType).subscribe(
|
||||
classifications => {
|
||||
ctx.patchState({
|
||||
classifications
|
||||
});
|
||||
}
|
||||
))
|
||||
);
|
||||
return this.classificationsService.putClassification(action.classification).pipe(take(1), tap(
|
||||
classifications => ctx.patchState({ classifications })
|
||||
));
|
||||
}
|
||||
|
||||
// initialize after Startup service has configured the taskanaRestUrl properly.
|
||||
|
|
Loading…
Reference in New Issue