diff --git a/packages/server/src/api/controllers/automation.ts b/packages/server/src/api/controllers/automation.ts index ab5b6e3fd7..6177868303 100644 --- a/packages/server/src/api/controllers/automation.ts +++ b/packages/server/src/api/controllers/automation.ts @@ -97,7 +97,7 @@ export async function destroy(ctx: UserCtx) { const automation = await sdk.automations.get(ctx.params.id) if (coreSdk.automations.isRowAction(automation)) { - ctx.throw("Row actions cannot be deleted", 400) + ctx.throw("Row actions automations cannot be deleted", 422) } 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 8fccb32299..990828dcde 100644 --- a/packages/server/src/api/routes/tests/automation.spec.ts +++ b/packages/server/src/api/routes/tests/automation.spec.ts @@ -433,7 +433,10 @@ describe("/automations", () => { .delete(`/api/automations/${automation._id}/${automation._rev}`) .set(config.defaultHeaders()) .expect("Content-Type", /json/) - .expect(400, { message: "Row actions cannot be deleted", status: 400 }) + .expect(422, { + message: "Row actions automations cannot be deleted", + status: 422, + }) expect(events.automation.deleted).not.toHaveBeenCalled() })