fix unsetting some values

- Category prefix
- category in motion multiSelect
This commit is contained in:
Maximilian Krambach 2019-02-28 17:06:17 +01:00 committed by Emanuel Schütze
parent 0c1abe561b
commit 4e3948a24d
2 changed files with 2 additions and 4 deletions

View File

@ -153,9 +153,7 @@ export class CategoryListComponent extends BaseViewComponent implements OnInit {
public async onSaveButton(viewCategory: ViewCategory): Promise<void> {
if (this.updateForm.dirty && this.updateForm.valid) {
const cat: Partial<Category> = { 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();
}

View File

@ -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
);
}