mirror of
https://github.com/sartography/cr-connect-bpmn.git
synced 2025-01-14 10:55:45 +00:00
remove 'if' from cat_change
breaks adding/removing categories
This commit is contained in:
parent
8e2b7c24a7
commit
35785caa2e
@ -220,14 +220,12 @@ export class WorkflowSpecListComponent implements OnInit {
|
|||||||
|
|
||||||
editCategoryDisplayOrder(catId: number, direction: string) {
|
editCategoryDisplayOrder(catId: number, direction: string) {
|
||||||
this.api.reorderWorkflowCategory(catId, direction).subscribe(cat_change => {
|
this.api.reorderWorkflowCategory(catId, direction).subscribe(cat_change => {
|
||||||
if(cat_change) {
|
|
||||||
this.workflowSpecsByCategory = this.workflowSpecsByCategory.map(cat => {
|
this.workflowSpecsByCategory = this.workflowSpecsByCategory.map(cat => {
|
||||||
let new_cat = cat_change.find(i2 => i2.id === cat.id);
|
let new_cat = cat_change.find(i2 => i2.id === cat.id);
|
||||||
cat.display_order = new_cat.display_order;
|
cat.display_order = new_cat.display_order;
|
||||||
return cat;
|
return cat;
|
||||||
});
|
});
|
||||||
this.workflowSpecsByCategory.sort((x,y) => x.display_order - y.display_order);
|
this.workflowSpecsByCategory.sort((x,y) => x.display_order - y.display_order);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user