0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 10:52:46 +00:00

Creating new home page, added new account route

This commit is contained in:
Scott Tolksdorf
2017-05-28 13:18:46 -04:00
parent b39f9041c2
commit fa203047da
10 changed files with 188 additions and 72 deletions

View File

@@ -1,6 +1,6 @@
const _ = require('lodash');
module.exports = (Brew) => {
module.exports = (BrewModel) => {
const cmds = {
termSearch : (terms='', opts, fullAccess) => {
let query = {};
@@ -42,7 +42,7 @@ module.exports = (Brew) => {
queryObj.published = true;
}
const searchQuery = Brew
const searchQuery = BrewModel
.find(queryObj)
.sort(opts.sort)
.select(filter)
@@ -51,7 +51,7 @@ module.exports = (Brew) => {
.lean()
.exec();
const countQuery = Brew.count(queryObj).exec();
const countQuery = BrewModel.count(queryObj).exec();
return Promise.all([searchQuery, countQuery])
.then((result) => {