Squash the oldRow variable to avoid issues when serialising. Added a try/catch when queuing automations in dev
This commit is contained in:
parent
9ba415878e
commit
a4a472b2d8
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
console.error("Failed to queue automation", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue