getUserPreference available for all UserPreferences

This commit is contained in:
smilerz
2021-10-16 13:32:27 -05:00
parent fbd17b48fe
commit c5c76cadea
7 changed files with 110 additions and 32 deletions

View File

@ -220,11 +220,6 @@ export const ApiMixin = {
return {
Models: Models,
Actions: Actions,
FoodCreateDefault: function (form) {
form.inherit_ignore = getUserPreference("food_ignore_default")
form.inherit = form.supermarket_category.length > 0
return form
},
}
},
methods: {
@ -536,11 +531,3 @@ const specialCases = {
})
},
}
export const formFunctions = {
FoodCreateDefault: function (form) {
form.fields.filter((x) => x.field === "ignore_inherit")[0].value = getUserPreference("food_ignore_default")
form.fields.filter((x) => x.field === "inherit")[0].value = getUserPreference("food_ignore_default").length > 0
return form
},
}