Refetch builder data

This commit is contained in:
Adria Navarro 2024-07-22 17:37:02 +02:00
parent 703e2c1873
commit 1081d415fa
1 changed files with 2 additions and 13 deletions

View File

@ -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 => {