fixed review shopping before save, improved meal plan edit modal independece
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user