1
0
Fork 0
mirror of synced 2024-09-06 12:41:24 +12:00

Fix bug where save row action was mutating the real context

This commit is contained in:
Andrew Kingston 2021-12-09 14:36:24 +00:00
parent d9278dbc24
commit 9ad25fcf88

View file

@ -14,7 +14,7 @@ const saveRowHandler = async (action, context) => {
const { fields, providerId, tableId } = action.parameters const { fields, providerId, tableId } = action.parameters
let payload let payload
if (providerId) { if (providerId) {
payload = context[providerId] payload = { ...context[providerId] }
} else { } else {
payload = {} payload = {}
} }
@ -202,7 +202,7 @@ export const enrichButtonActions = (actions, context) => {
// Get and enrich this button action with the total context // Get and enrich this button action with the total context
let action = actions[i] let action = actions[i]
action = enrichDataBindings(action, totalContext) action = enrichDataBindings(action, totalContext)
const callback = async () => handlers[i](action, context) const callback = async () => handlers[i](action, totalContext)
// If this action is confirmable, show confirmation and await a // If this action is confirmable, show confirmation and await a
// callback to execute further actions // callback to execute further actions