diff options
Diffstat (limited to 'server/lib/api/layouts.js')
| -rw-r--r-- | server/lib/api/layouts.js | 17 |
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, + }) + }) }) }, |
