From: Bill Erickson Date: Tue, 7 Jun 2022 16:11:02 +0000 (-0400) Subject: LP1904036 Patron edit stat cat create + delete handled OK X-Git-Url: http://git.equinoxoli.org/?p=evergreen-equinox.git;a=commitdiff_plain;h=b1ad3b898d267ac57c2e5ae7f6a1e01926b1f659 LP1904036 Patron edit stat cat create + delete handled OK Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- 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 57cf8f9..18667f3 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');