From 1081d415fa1b38ec7b1209e858dff7251be90874 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jul 2024 17:37:02 +0200 Subject: [PATCH] Refetch builder data --- .../builder/src/stores/builder/automations.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/packages/builder/src/stores/builder/automations.js b/packages/builder/src/stores/builder/automations.js index c1cb963ac4..57c823da9b 100644 --- a/packages/builder/src/stores/builder/automations.js +++ b/packages/builder/src/stores/builder/automations.js @@ -104,19 +104,8 @@ const automationActions = store => ({ }, save: async automation => { const response = await API.updateAutomation(automation) - store.update(state => { - const updatedAutomation = response.automation - const existingIdx = state.automations.findIndex( - existing => existing._id === automation._id - ) - if (existingIdx !== -1) { - state.automations.splice(existingIdx, 1, updatedAutomation) - return state - } else { - state.automations = [...state.automations, updatedAutomation] - } - return state - }) + + await store.actions.fetch() return response.automation }, delete: async automation => {