mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-22 05:47:02 +00:00
Converting raw mongoose objects to json
This commit is contained in:
1 parent
34b21703e1
commit
91c7f45d33
1 file changed
+2
-2
@@ -62,7 +62,7 @@ app.get('/edit/:id', function(req, res){
|
||||
var resObj = null;
|
||||
var errObj = {text: "# oops\nCould not find the homebrew."}
|
||||
if(objs.length){
|
||||
resObj = objs[0];
|
||||
resObj = objs[0].toJSON();
|
||||
}
|
||||
|
||||
vitreumRender({
|
||||
@@ -102,7 +102,7 @@ app.get('/share/:id', function(req, res){
|
||||
prerenderWith : './client/homebrew/homebrew.jsx',
|
||||
initialProps: {
|
||||
url: req.originalUrl,
|
||||
brew : sanitizeBrew(resObj || errObj)
|
||||
brew : sanitizeBrew(resObj.toJSON() || errObj)
|
||||
},
|
||||
clearRequireCache : !process.env.PRODUCTION,
|
||||
}, function (err, page) {
|
||||
|
||||
Reference in new issue
Block a user