From b1ad3b898d267ac57c2e5ae7f6a1e01926b1f659 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 7 Jun 2022 12:11:02 -0400 Subject: [PATCH] LP1904036 Patron edit stat cat create + delete handled OK Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts index 57cf8f9877..18667f3f14 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts @@ -901,7 +901,17 @@ export class EditComponent implements OnInit, AfterViewInit { map.ischanged(true); map.isdeleted(false); } else { - map.isdeleted(true); + if (map.isnew()) { + // Deleting a stat cat that was created during this + // edit session just means removing it from the list + // of maps to consider. + this.patron.stat_cat_entries( + this.patron.stat_cat_entries() + .filter(m => m.stat_cat() !== cat.id()) + ); + } else { + map.isdeleted(true); + } } } else { map = this.idl.create('actscecm'); -- 2.11.0