diff --git a/packages/server/src/api/controllers/automation.ts b/packages/server/src/api/controllers/automation.ts index 2e7914f60b..35799e5dee 100644 --- a/packages/server/src/api/controllers/automation.ts +++ b/packages/server/src/api/controllers/automation.ts @@ -99,7 +99,7 @@ export async function destroy(ctx: UserCtx) { if ( automation.definition.trigger.stepId === AutomationTriggerStepId.ROW_ACTION ) { - ctx.throw("Row actions cannot be deleted", 403) + ctx.throw("Row actions cannot be deleted", 400) } ctx.body = await sdk.automations.remove(automationId, ctx.params.rev) diff --git a/packages/server/src/api/routes/tests/automation.spec.ts b/packages/server/src/api/routes/tests/automation.spec.ts index a82bc68465..8fccb32299 100644 --- a/packages/server/src/api/routes/tests/automation.spec.ts +++ b/packages/server/src/api/routes/tests/automation.spec.ts @@ -433,7 +433,7 @@ describe("/automations", () => { .delete(`/api/automations/${automation._id}/${automation._rev}`) .set(config.defaultHeaders()) .expect("Content-Type", /json/) - .expect(403, { message: "Row actions cannot be deleted", status: 403 }) + .expect(400, { message: "Row actions cannot be deleted", status: 400 }) expect(events.automation.deleted).not.toHaveBeenCalled() })