Support to delete project feature (#1509)

* First commit to support to delete projects

* Add delete project menu & Implement delete project API

* Correspond to the PR feedback
This commit is contained in:
Hideki Nakamura
2017-12-07 23:28:26 +09:00
committed by Nick O'Leary
parent 304c597a2f
commit 3adfe249b0
5 changed files with 103 additions and 1 deletions

View File

@@ -117,6 +117,13 @@ module.exports = {
// Delete project - tbd
app.delete("/:id", needsPermission("projects.write"), function(req,res) {
runtime.storage.projects.deleteProject(req.user, req.params.id).then(function() {
res.status(204).end();
})
.catch(function(err) {
console.log(err.stack);
res.status(400).json({error:"unexpected_error", message:err.toString()})
});
});