1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-12 23:45:57 +00:00

Converting raw mongoose objects to json

This commit is contained in:
Scott Tolksdorf
2016-08-09 13:32:46 -04:00
parent 34b21703e1
commit 91c7f45d33

View File

@@ -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) {