Commit c9f7c0fe authored by ZeHiro's avatar ZeHiro
Browse files

Delete operation: server side

parent 397f64a4
......@@ -160,3 +160,14 @@ export async function create(req, res) {
return asyncErr(res, err, 'when creating operation for a bank account');
}
}
// Delete an operation
module.exports.destroy = async function(req, res) {
try {
let op = req.preloaded.operation;
await op.destroy();
res.sendStatus(204);
} catch (err) {
return asyncErr(res, err, 'when deleting operation');
}
};
......@@ -83,7 +83,8 @@ module.exports = {
param: operations.preloadOtherOperation
},
'operations/:operationID': {
put: operations.update
put: operations.update,
delete: operations.destroy
},
'operations/:operationID/mergeWith/:otherOperationID': {
put: operations.merge
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment