Add custom project.toJSON to simplify state mangement

This commit is contained in:
Nick O'Leary
2017-10-17 10:14:50 +01:00
parent 4569cb432d
commit 5218a3fbac
5 changed files with 70 additions and 46 deletions

View File

@@ -49,10 +49,8 @@ module.exports = {
app.post("/", function(req,res) {
// Create project
runtime.storage.projects.createProject(req.body).then(function(name) {
runtime.storage.projects.getProject(name).then(function(data) {
res.json(data);
});
runtime.storage.projects.createProject(req.body).then(function(data) {
res.json(data);
}).catch(function(err) {
console.log(err.stack);
if (err.code) {