fixed review shopping before save, improved meal plan edit modal independece

This commit is contained in:
vabene1111
2023-02-18 21:55:17 +01:00
parent 3c00e1ecdb
commit c08c1d30ad
4 changed files with 42 additions and 42 deletions

View File

@ -78,6 +78,7 @@ const {ApiApiFactory} = require("@/utils/openapi/api")
import {StandardToasts} from "@/utils/utils"
import IngredientComponent from "@/components/IngredientComponent"
import LoadingSpinner from "@/components/LoadingSpinner"
import {useMealPlanStore} from "@/stores/MealPlanStore";
// import CustomInputSpinButton from "@/components/CustomInputSpinButton"
export default {
@ -88,7 +89,7 @@ export default {
recipe: {required: true, type: Object},
servings: {type: Number, default: undefined},
modal_id: {required: true, type: Number},
mealplan: {type: Number, default: undefined},
mealplan: {type: Object, default: undefined},
list_recipe: {type: Number, default: undefined},
},
data() {
@ -169,6 +170,9 @@ export default {
.then((result) => {
StandardToasts.makeStandardToast(this, StandardToasts.SUCCESS_CREATE)
this.$emit("finish")
if (this.mealplan !== undefined && this.mealplan !== null){
useMealPlanStore().plans[this.mealplan.id].shopping = true
}
})
.catch((err) => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_CREATE, err)