Add dryRun to automation row create and remove env conditional on delete
This commit is contained in:
parent
fc043e116d
commit
604d316834
|
@ -82,8 +82,9 @@ exports.run = async function ({ inputs, appId, emitter }) {
|
||||||
inputs.row.tableId,
|
inputs.row.tableId,
|
||||||
inputs.row
|
inputs.row
|
||||||
)
|
)
|
||||||
await usage.update(usage.Properties.ROW, 1)
|
await usage.update(usage.Properties.ROW, 1, { dryRun: true })
|
||||||
await rowController.save(ctx)
|
await rowController.save(ctx)
|
||||||
|
await usage.update(usage.Properties.ROW, 1)
|
||||||
return {
|
return {
|
||||||
row: inputs.row,
|
row: inputs.row,
|
||||||
response: ctx.body,
|
response: ctx.body,
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
const rowController = require("../../api/controllers/row")
|
const rowController = require("../../api/controllers/row")
|
||||||
const env = require("../../environment")
|
|
||||||
const usage = require("../../utilities/usageQuota")
|
const usage = require("../../utilities/usageQuota")
|
||||||
const { buildCtx } = require("./utils")
|
const { buildCtx } = require("./utils")
|
||||||
const automationUtils = require("../automationUtils")
|
const automationUtils = require("../automationUtils")
|
||||||
|
@ -74,9 +73,7 @@ exports.run = async function ({ inputs, appId, emitter }) {
|
||||||
})
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (env.isProd()) {
|
await usage.update(usage.Properties.ROW, -1)
|
||||||
await usage.update(usage.Properties.ROW, -1)
|
|
||||||
}
|
|
||||||
await rowController.destroy(ctx)
|
await rowController.destroy(ctx)
|
||||||
return {
|
return {
|
||||||
response: ctx.body,
|
response: ctx.body,
|
||||||
|
|
|
@ -25,12 +25,12 @@ exports.useQuotas = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.Properties = {
|
exports.Properties = {
|
||||||
ROW: "rows", // mostly works - app / table deletion not yet accounted for
|
ROW: "rows",
|
||||||
UPLOAD: "storage", // doesn't work yet
|
UPLOAD: "storage", // doesn't work yet
|
||||||
VIEW: "views", // doesn't work yet
|
VIEW: "views", // doesn't work yet
|
||||||
USER: "users", // doesn't work yet
|
USER: "users", // doesn't work yet
|
||||||
AUTOMATION: "automationRuns", // doesn't work yet
|
AUTOMATION: "automationRuns", // doesn't work yet
|
||||||
APPS: "apps", // works
|
APPS: "apps",
|
||||||
EMAILS: "emails", // doesn't work yet
|
EMAILS: "emails", // doesn't work yet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue