From 18e8ca03b90f124968400ccc742744c3ed01547a Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 7 Aug 2015 18:36:25 -0400 Subject: cleanup --- server/lib/api/layouts.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'server/lib/api') 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, + }) + }) }) }, -- cgit v1.2.3-70-g09d2