Fix bug where save duplicate action was mutating the real context

This commit is contained in:
Andrew Kingston 2021-12-09 14:36:57 +00:00
parent 9ad25fcf88
commit eedd1f0cf6
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ const saveRowHandler = async (action, context) => {
const duplicateRowHandler = async (action, context) => { const duplicateRowHandler = async (action, context) => {
const { fields, providerId, tableId } = action.parameters const { fields, providerId, tableId } = action.parameters
if (providerId) { if (providerId) {
let draft = context[providerId] let draft = { ...context[providerId] }
if (fields) { if (fields) {
for (let [field, value] of Object.entries(fields)) { for (let [field, value] of Object.entries(fields)) {
draft[field] = value draft[field] = value