From 1eb18ebb6d2ea66ef621587969fe9ce345b87775 Mon Sep 17 00:00:00 2001 From: Maksym Tsymbarov Date: Sun, 9 Nov 2025 13:18:33 +0200 Subject: [PATCH] added handling of delete entity case on entity list component --- .../recipient-notification-dialog.component.html | 1 + .../components/entity/entity-list.component.ts | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ui-ngx/src/app/modules/home/pages/notification/recipient/recipient-notification-dialog.component.html b/ui-ngx/src/app/modules/home/pages/notification/recipient/recipient-notification-dialog.component.html index ff239f7155..95715bef87 100644 --- a/ui-ngx/src/app/modules/home/pages/notification/recipient/recipient-notification-dialog.component.html +++ b/ui-ngx/src/app/modules/home/pages/notification/recipient/recipient-notification-dialog.component.html @@ -92,6 +92,7 @@ 0) { this.modelValue = [...value]; - this.entityService.getEntities(this.entityType, value).subscribe( - (entities) => { - this.entities = entities; + this.entityService.getEntities(this.entityType, value) + .subscribe(resolvedEntities => { + this.entities = resolvedEntities; this.entityListFormGroup.get('entities').setValue(this.entities); - if (this.syncIdsWithDB && this.modelValue.length !== entities.length) { - this.modelValue = entities.map(entity => entity.id.id); + if (this.syncIdsWithDB && this.modelValue.length !== this.entities.length) { + this.modelValue = this.entities.map(entity => entity.id.id); + if (!this.modelValue.length) { + this.modelValue = null; + } this.propagateChange(this.modelValue); } - } - ); + }); } else { this.entities = []; this.entityListFormGroup.get('entities').setValue(this.entities);