fix shopping list api

This commit is contained in:
smilerz
2021-12-20 12:27:25 -06:00
parent f5e4adba8b
commit 2d94cb70ab
8 changed files with 174 additions and 28 deletions

View File

@@ -269,13 +269,13 @@ export interface FoodIgnoreInherit {
* @type {string}
* @memberof FoodIgnoreInherit
*/
name: string;
name?: string;
/**
*
* @type {string}
* @memberof FoodIgnoreInherit
*/
field: string;
field?: string;
}
/**
*
@@ -294,13 +294,13 @@ export interface FoodInheritField {
* @type {string}
* @memberof FoodInheritField
*/
name: string;
name?: string;
/**
*
* @type {string}
* @memberof FoodInheritField
*/
field: string;
field?: string;
}
/**
*

View File

@@ -369,6 +369,9 @@ export function getForm(model, action, item1, item2) {
if (f === "partialUpdate" && Object.keys(config).length == 0) {
config = { ...Actions.CREATE?.form, ...model.model_type?.["create"]?.form, ...model?.["create"]?.form }
config["title"] = { ...action?.form_title, ...model.model_type?.[f]?.form_title, ...model?.[f]?.form_title }
if (config["form_function"].includes("Create")) {
delete config["form_function"]
}
}
let form = { fields: [] }
let value = ""
@@ -541,6 +544,7 @@ 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
console.log(form)
return form
},
}