1
0
Fork 0
mirror of synced 2024-09-20 19:33:10 +12:00

Return 400 instead of 403

This commit is contained in:
Adria Navarro 2024-07-23 11:59:14 +02:00
parent 8678db18e2
commit 35bbccec67
2 changed files with 2 additions and 2 deletions

View file

@ -99,7 +99,7 @@ export async function destroy(ctx: UserCtx<void, DeleteAutomationResponse>) {
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)

View file

@ -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()
})