summaryrefslogtreecommitdiff
path: root/server/lib/api/layouts.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-08-07 18:36:25 -0400
committerJules Laplace <jules@okfoc.us>2015-08-07 18:36:25 -0400
commit18e8ca03b90f124968400ccc742744c3ed01547a (patch)
tree7ed7f7292e36f96aa5af7d83dd38ab7bc776149d /server/lib/api/layouts.js
parente0aebb7ef327f29c0ab8f5b75a24c5d823dfd90f (diff)
cleanup
Diffstat (limited to 'server/lib/api/layouts.js')
-rw-r--r--server/lib/api/layouts.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/server/lib/api/layouts.js b/server/lib/api/layouts.js
index a3edc38..f1db121 100644
--- a/server/lib/api/layouts.js
+++ b/server/lib/api/layouts.js
@@ -9,13 +9,16 @@ var _ = require('lodash'),
var layouts = {
index: function(req, res){
- Layout.find({}, function(err, docs){
- res.json({
- layouts: docs,
- user: res.locals.user,
- layoutCounts: res.locals.layoutCounts,
- projectCounts: res.locals.projectCounts,
- })
+ Layout.find({ is_stock: true }, function(err, stock_layouts){
+ Layout.find({ user_id: req.user._id }, function(err, user_layouts){
+ res.json({
+ layouts: stock_layouts,
+ user_layouts: user_layouts,
+ user: res.locals.user,
+ layoutCount: res.locals.layoutCount,
+ projectCount: res.locals.projectCount,
+ })
+ })
})
},