From 9ad25fcf884b76fbccb58f5effecc5b28bf90e5b Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 9 Dec 2021 14:36:24 +0000 Subject: [PATCH] Fix bug where save row action was mutating the real context --- packages/client/src/utils/buttonActions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index f5f88b9151..b1d49b0351 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -14,7 +14,7 @@ const saveRowHandler = async (action, context) => { const { fields, providerId, tableId } = action.parameters let payload if (providerId) { - payload = context[providerId] + payload = { ...context[providerId] } } else { payload = {} } @@ -202,7 +202,7 @@ export const enrichButtonActions = (actions, context) => { // Get and enrich this button action with the total context let action = actions[i] 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 // callback to execute further actions