fix categories in supermarket edit modal

This commit is contained in:
smilerz
2021-12-21 13:40:50 -06:00
parent dfe414985b
commit 42132568c4
6 changed files with 22 additions and 10 deletions

View File

@ -315,7 +315,6 @@ export default {
this.genericAPI(this.this_model, this.Actions.MOVE, { source: source_id, target: target_id })
.then((result) => {
this.moveUpdateItem(source_id, target_id)
// TODO make standard toast
StandardToasts.makeStandardToast(StandardToasts.SUCCESS_MOVE)
})
.catch((err) => {
@ -355,7 +354,6 @@ export default {
})
.then((result) => {
this.mergeUpdateItem(source_id, target_id)
// TODO make standard toast
StandardToasts.makeStandardToast(StandardToasts.SUCCESS_MERGE)
})
.catch((err) => {
@ -416,7 +414,7 @@ export default {
getRecipes: function (col, item) {
let parent = {}
// TODO: make this generic
let params = { pageSize: 50 }
let params = { pageSize: 50, random: true }
params[this.this_recipe_param] = item.id
console.log("RECIPE PARAM", this.this_recipe_param, params, item.id)
this.genericAPI(this.Models.RECIPE, this.Actions.LIST, params)

View File

@ -80,9 +80,7 @@ export default {
} else {
arrayValues = [{ id: -1, name: this_value }]
}
console.log(arrayValues)
if (this.form?.ordered && this.first_run) {
if (this.form?.ordered && this.first_run && arrayValues.length > 0) {
return this.flattenItems(arrayValues)
} else {
return arrayValues

View File

@ -125,8 +125,6 @@ export default {
entry.date = moment(entry.date).format("YYYY-MM-DD")
let apiClient = new ApiApiFactory()
console.log("etnry", entry)
apiClient
.createMealPlan(entry)
.then((result) => {

View File

@ -369,7 +369,7 @@ 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")) {
if (config?.["form_function"]?.includes("Create")) {
delete config["form_function"]
}
}