Merge pull request #14097 from Budibase/fix/squash-oldrow-in-external-row-controller
Squash the oldRow prop in the external row controller
This commit is contained in:
commit
581721caf7
|
@ -72,15 +72,23 @@ export async function patch(ctx: UserCtx<PatchRowRequest, PatchRowResponse>) {
|
|||
const row = await sdk.rows.external.getRow(tableId, updatedId, {
|
||||
relationships: true,
|
||||
})
|
||||
const enrichedRow = await outputProcessing(table, row, {
|
||||
squash: true,
|
||||
preserveLinks: true,
|
||||
})
|
||||
|
||||
const [enrichedRow, oldRow] = await Promise.all([
|
||||
outputProcessing(table, row, {
|
||||
squash: true,
|
||||
preserveLinks: true,
|
||||
}),
|
||||
outputProcessing(table, beforeRow, {
|
||||
squash: true,
|
||||
preserveLinks: true,
|
||||
}),
|
||||
])
|
||||
|
||||
return {
|
||||
...response,
|
||||
row: enrichedRow,
|
||||
table,
|
||||
oldRow: beforeRow,
|
||||
oldRow,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import { automationQueue } from "./bullboard"
|
|||
import { checkTestFlag } from "../utilities/redis"
|
||||
import * as utils from "./utils"
|
||||
import env from "../environment"
|
||||
import { context, db as dbCore } from "@budibase/backend-core"
|
||||
import { context, logging, db as dbCore } from "@budibase/backend-core"
|
||||
import {
|
||||
Automation,
|
||||
Row,
|
||||
|
@ -66,7 +66,11 @@ async function queueRelevantRowAutomations(
|
|||
automationTrigger?.inputs &&
|
||||
automationTrigger.inputs.tableId === event.row.tableId
|
||||
) {
|
||||
await automationQueue.add({ automation, event }, JOB_OPTS)
|
||||
try {
|
||||
await automationQueue.add({ automation, event }, JOB_OPTS)
|
||||
} catch (e) {
|
||||
logging.logAlert("Failed to queue automation", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue