Use tableId parameter when saving rows from button action
This commit is contained in:
parent
cfab8d2713
commit
7343c947ae
1 changed files with 4 additions and 1 deletions
|
@ -4,7 +4,7 @@ import { saveRow, deleteRow, executeQuery, triggerAutomation } from "../api"
|
||||||
import { ActionTypes } from "../constants"
|
import { ActionTypes } from "../constants"
|
||||||
|
|
||||||
const saveRowHandler = async (action, context) => {
|
const saveRowHandler = async (action, context) => {
|
||||||
const { fields, providerId } = action.parameters
|
const { fields, providerId, tableId } = action.parameters
|
||||||
if (providerId) {
|
if (providerId) {
|
||||||
let draft = context[providerId]
|
let draft = context[providerId]
|
||||||
if (fields) {
|
if (fields) {
|
||||||
|
@ -12,6 +12,9 @@ const saveRowHandler = async (action, context) => {
|
||||||
draft[field] = value
|
draft[field] = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (tableId) {
|
||||||
|
draft.tableId = tableId
|
||||||
|
}
|
||||||
await saveRow(draft)
|
await saveRow(draft)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue