fix unsetting some values
- Category prefix - category in motion multiSelect
This commit is contained in:
parent
0c1abe561b
commit
4e3948a24d
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user