Fix flow api unit tests

This commit is contained in:
Nick O'Leary
2020-09-29 17:35:43 +01:00
parent ea45dde63a
commit 7a90fe5aec
2 changed files with 7 additions and 4 deletions

View File

@@ -194,14 +194,13 @@ var api = module.exports = {
var id = opts.id;
return runtime.flows.removeFlow(id, opts.user).then(function () {
runtime.log.audit({event: "flow.remove", id: id}, opts.req);
return resolve();
return;
}).catch(function (err) {
if (err.code === 404) {
runtime.log.audit({event: "flow.remove", id: id, error: "not_found"}, opts.req);
// TODO: this swap around of .code and .status isn't ideal
err.status = 404;
err.code = "not_found";
return reject(err);
} else {
runtime.log.audit({
event: "flow.remove",