close #2552 Added: Quick category modal add parent category field

This commit is contained in:
Cüneyt Şentürk
2022-07-26 15:56:43 +03:00
parent 91ce0e5aa8
commit 040527734d
4 changed files with 51 additions and 4 deletions

View File

@ -228,6 +228,8 @@ export default {
'#efef32'
],
min_date: false,
categoriesBasedTypes: null,
isParentCategoryDisabled: true,
}
},
@ -288,6 +290,28 @@ export default {
.catch(error => {
});
},
updateParentCategories(event) {
if (event === '') {
return;
}
if (typeof JSON.parse(this.form.categories)[event] === 'undefined') {
this.categoriesBasedTypes = [];
this.isParentCategoryDisabled = true;
return;
}
if (this.form.parent_category_id) {
this.form.parent_category_id = null;
return;
}
this.categoriesBasedTypes = JSON.parse(this.form.categories)[event];
this.isParentCategoryDisabled = false;
},
}
})
});