TSK-1214: Removed unneccessary copies and GET call

This commit is contained in:
Tristan Eisermann 2020-06-17 13:05:55 +02:00 committed by Mustapha Zorgati
parent 7b5927d281
commit dbdf3e6b03
2 changed files with 4 additions and 12 deletions

View File

@ -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 => {

View File

@ -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.