Return 400 instead of 403
This commit is contained in:
parent
8678db18e2
commit
35bbccec67
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue