summaryrefslogtreecommitdiff
path: root/server/lib/api/blueprint.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-08-26 12:24:12 -0400
committerJules Laplace <jules@okfoc.us>2015-08-26 12:24:12 -0400
commit73b8036e977a21d4b1e327245d02826eade3c843 (patch)
tree92ad9387494108da1a52eb627192f5ae4c848f25 /server/lib/api/blueprint.js
parent630c08b712a2ace833217428f1ef20bddc0b975d (diff)
loading rooms into editor
Diffstat (limited to 'server/lib/api/blueprint.js')
-rw-r--r--server/lib/api/blueprint.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/server/lib/api/blueprint.js b/server/lib/api/blueprint.js
index 222b466..e780b92 100644
--- a/server/lib/api/blueprint.js
+++ b/server/lib/api/blueprint.js
@@ -25,6 +25,21 @@ var blueprint = {
})
},
+ show: function(req, res){
+ Blueprint.findOne({ slug: req.params.slug }, function(err, doc){
+ if (doc) {
+ res.json(doc)
+ return
+ }
+ else {
+ Project.count({}, function(err, count){
+ var name = "Project #" + (count || 0)
+ res.json({ _id: "new", name: name, isNew: true })
+ })
+ }
+ })
+ },
+
create: function(req, res){
var data = util.cleanQuery(req.body)
data.user_id = req.user._id