From beed0de6cef85573312eb6b4b593a6fae16b6608 Mon Sep 17 00:00:00 2001 From: hay-kot Date: Sat, 1 May 2021 15:56:14 -0800 Subject: [PATCH] use Vue.delete to update store --- frontend/src/store/modules/recipes.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/store/modules/recipes.js b/frontend/src/store/modules/recipes.js index a419b7762..887acb49d 100644 --- a/frontend/src/store/modules/recipes.js +++ b/frontend/src/store/modules/recipes.js @@ -1,4 +1,5 @@ import { api } from "@/api"; +import Vue from "vue"; const state = { recentRecipes: [], @@ -16,7 +17,7 @@ const mutations = { }, dropRecentRecipes(state, payload) { if (state.recentRecipes[payload.id]) { - delete state.recentRecipes[payload.id]; + Vue.delete(state.recentRecipes, payload.id); } }, setAllRecipes(state, payload) { @@ -27,7 +28,7 @@ const mutations = { }, dropAllRecipes(state, payload) { if (state.allRecipes[payload.id]) { - delete state.allRecipes[payload.id]; + Vue.delete(state.allRecipes, payload.id); } }, };