Merge pull request #4435 from MaximilianKrambach/motion_deleteCategory

fix unsetting some values
This commit is contained in:
Emanuel Schütze 2019-02-28 19:24:40 +01:00 committed by GitHub
commit d77abf5934
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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> { public async onSaveButton(viewCategory: ViewCategory): Promise<void> {
if (this.updateForm.dirty && this.updateForm.valid) { if (this.updateForm.dirty && this.updateForm.valid) {
const cat: Partial<Category> = { name: this.updateForm.get('name').value }; 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); await this.repo.update(cat, viewCategory);
this.updateForm.markAsPristine(); this.updateForm.markAsPristine();
} }

View File

@ -147,7 +147,7 @@ export class MotionMultiselectService {
if (selectedChoice) { if (selectedChoice) {
for (const motion of motions) { for (const motion of motions) {
await this.repo.update( await this.repo.update(
{ category_id: selectedChoice.action ? 0 : (selectedChoice.items as number) }, { category_id: selectedChoice.action ? null : (selectedChoice.items as number) },
motion motion
); );
} }