From 4e3948a24da74703f574560a19677e97c851bf4b Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Thu, 28 Feb 2019 17:06:17 +0100 Subject: [PATCH] fix unsetting some values - Category prefix - category in motion multiSelect --- .../components/category-list/category-list.component.ts | 4 +--- .../app/site/motions/services/motion-multiselect.service.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/src/app/site/motions/components/category-list/category-list.component.ts b/client/src/app/site/motions/components/category-list/category-list.component.ts index 5aa853928..206aaa50e 100644 --- a/client/src/app/site/motions/components/category-list/category-list.component.ts +++ b/client/src/app/site/motions/components/category-list/category-list.component.ts @@ -153,9 +153,7 @@ export class CategoryListComponent extends BaseViewComponent implements OnInit { public async onSaveButton(viewCategory: ViewCategory): Promise { if (this.updateForm.dirty && this.updateForm.valid) { const cat: Partial = { name: this.updateForm.get('name').value }; - if (this.updateForm.get('prefix').value) { - cat.prefix = this.updateForm.get('prefix').value; - } + cat.prefix = this.updateForm.get('prefix').value || ''; await this.repo.update(cat, viewCategory); this.updateForm.markAsPristine(); } diff --git a/client/src/app/site/motions/services/motion-multiselect.service.ts b/client/src/app/site/motions/services/motion-multiselect.service.ts index f8e06a772..14d882534 100644 --- a/client/src/app/site/motions/services/motion-multiselect.service.ts +++ b/client/src/app/site/motions/services/motion-multiselect.service.ts @@ -147,7 +147,7 @@ export class MotionMultiselectService { if (selectedChoice) { for (const motion of motions) { await this.repo.update( - { category_id: selectedChoice.action ? 0 : (selectedChoice.items as number) }, + { category_id: selectedChoice.action ? null : (selectedChoice.items as number) }, motion ); }