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, {
|
const row = await sdk.rows.external.getRow(tableId, updatedId, {
|
||||||
relationships: true,
|
relationships: true,
|
||||||
})
|
})
|
||||||
const enrichedRow = await outputProcessing(table, row, {
|
|
||||||
squash: true,
|
const [enrichedRow, oldRow] = await Promise.all([
|
||||||
preserveLinks: true,
|
outputProcessing(table, row, {
|
||||||
})
|
squash: true,
|
||||||
|
preserveLinks: true,
|
||||||
|
}),
|
||||||
|
outputProcessing(table, beforeRow, {
|
||||||
|
squash: true,
|
||||||
|
preserveLinks: true,
|
||||||
|
}),
|
||||||
|
])
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...response,
|
...response,
|
||||||
row: enrichedRow,
|
row: enrichedRow,
|
||||||
table,
|
table,
|
||||||
oldRow: beforeRow,
|
oldRow,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { automationQueue } from "./bullboard"
|
||||||
import { checkTestFlag } from "../utilities/redis"
|
import { checkTestFlag } from "../utilities/redis"
|
||||||
import * as utils from "./utils"
|
import * as utils from "./utils"
|
||||||
import env from "../environment"
|
import env from "../environment"
|
||||||
import { context, db as dbCore } from "@budibase/backend-core"
|
import { context, logging, db as dbCore } from "@budibase/backend-core"
|
||||||
import {
|
import {
|
||||||
Automation,
|
Automation,
|
||||||
Row,
|
Row,
|
||||||
|
@ -66,7 +66,11 @@ async function queueRelevantRowAutomations(
|
||||||
automationTrigger?.inputs &&
|
automationTrigger?.inputs &&
|
||||||
automationTrigger.inputs.tableId === event.row.tableId
|
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