remove 'if' from cat_change

breaks adding/removing categories
This commit is contained in:
alicia pritchett 2021-09-29 11:04:42 -04:00
parent 8e2b7c24a7
commit 35785caa2e
1 changed files with 0 additions and 2 deletions

View File

@ -220,14 +220,12 @@ export class WorkflowSpecListComponent implements OnInit {
editCategoryDisplayOrder(catId: number, direction: string) {
this.api.reorderWorkflowCategory(catId, direction).subscribe(cat_change => {
if(cat_change) {
this.workflowSpecsByCategory = this.workflowSpecsByCategory.map(cat => {
let new_cat = cat_change.find(i2 => i2.id === cat.id);
cat.display_order = new_cat.display_order;
return cat;
});
this.workflowSpecsByCategory.sort((x,y) => x.display_order - y.display_order);
}
});
}