mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
use Vue.delete to update store
This commit is contained in:
parent
6fdeb95ca3
commit
beed0de6ce
1 changed files with 3 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
import { api } from "@/api";
|
import { api } from "@/api";
|
||||||
|
import Vue from "vue";
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
recentRecipes: [],
|
recentRecipes: [],
|
||||||
|
@ -16,7 +17,7 @@ const mutations = {
|
||||||
},
|
},
|
||||||
dropRecentRecipes(state, payload) {
|
dropRecentRecipes(state, payload) {
|
||||||
if (state.recentRecipes[payload.id]) {
|
if (state.recentRecipes[payload.id]) {
|
||||||
delete state.recentRecipes[payload.id];
|
Vue.delete(state.recentRecipes, payload.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setAllRecipes(state, payload) {
|
setAllRecipes(state, payload) {
|
||||||
|
@ -27,7 +28,7 @@ const mutations = {
|
||||||
},
|
},
|
||||||
dropAllRecipes(state, payload) {
|
dropAllRecipes(state, payload) {
|
||||||
if (state.allRecipes[payload.id]) {
|
if (state.allRecipes[payload.id]) {
|
||||||
delete state.allRecipes[payload.id];
|
Vue.delete(state.allRecipes, payload.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue