Use 422 instead of 400 trying to delete row action automations
This commit is contained in:
parent
af0b69e8b6
commit
a03094db33
|
@ -97,7 +97,7 @@ export async function destroy(ctx: UserCtx<void, DeleteAutomationResponse>) {
|
|||
|
||||
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)
|
||||
|
|
|
@ -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()
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue