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, {
|
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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
console.error("Failed to queue automation", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue