mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix flow api unit tests
This commit is contained in:
@@ -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",
|
||||
|
Reference in New Issue
Block a user