Browse Source

Disable recursive row update on cloud automations

master
Rory Powell 4 years ago
parent
commit
cbc4a65749
  1. 3
      packages/server/src/api/controllers/row/index.ts
  2. 2
      packages/server/src/automations/steps/updateRow.js

3
packages/server/src/api/controllers/row/index.ts

@ -35,8 +35,9 @@ export async function patch(ctx: any): Promise<any> {
pickApi(tableId).patch(ctx) pickApi(tableId).patch(ctx)
) )
ctx.status = 200 ctx.status = 200
ctx.eventEmitter && if (!ctx.disableEmit && ctx.eventEmitter) {
ctx.eventEmitter.emitRow(`row:update`, appId, row, table) ctx.eventEmitter.emitRow(`row:update`, appId, row, table)
}
ctx.message = `${table.name} updated successfully.` ctx.message = `${table.name} updated successfully.`
ctx.body = row ctx.body = row
} catch (err) { } catch (err) {

2
packages/server/src/automations/steps/updateRow.js

@ -1,6 +1,7 @@
const rowController = require("../../api/controllers/row") const rowController = require("../../api/controllers/row")
const automationUtils = require("../automationUtils") const automationUtils = require("../automationUtils")
const { buildCtx } = require("./utils") const { buildCtx } = require("./utils")
const env = require("../../environment")
exports.definition = { exports.definition = {
name: "Update Row", name: "Update Row",
@ -83,6 +84,7 @@ exports.run = async function ({ inputs, appId, emitter }) {
rowId: inputs.rowId, rowId: inputs.rowId,
tableId: tableId, tableId: tableId,
}, },
disableEmit: !env.SELF_HOSTED,
}) })
try { try {

Loading…
Cancel
Save