Browse Source
Merge pull request #2065 from Budibase/fix/save-row-action
Use tableId parameter when saving rows from button action
pull/2086/head
Andrew Kingston
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
1 deletions
-
packages/client/src/utils/buttonActions.js
|
|
|
@ -4,7 +4,7 @@ import { saveRow, deleteRow, executeQuery, triggerAutomation } from "../api" |
|
|
|
import { ActionTypes } from "../constants" |
|
|
|
|
|
|
|
const saveRowHandler = async (action, context) => { |
|
|
|
const { fields, providerId } = action.parameters |
|
|
|
const { fields, providerId, tableId } = action.parameters |
|
|
|
if (providerId) { |
|
|
|
let draft = context[providerId] |
|
|
|
if (fields) { |
|
|
|
@ -12,6 +12,9 @@ const saveRowHandler = async (action, context) => { |
|
|
|
draft[field] = value |
|
|
|
} |
|
|
|
} |
|
|
|
if (tableId) { |
|
|
|
draft.tableId = tableId |
|
|
|
} |
|
|
|
await saveRow(draft) |
|
|
|
} |
|
|
|
} |
|
|
|
|