mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-22 13:21:29 +00:00
Converting raw mongoose objects to json
This commit is contained in:
@@ -62,7 +62,7 @@ app.get('/edit/:id', function(req, res){
|
|||||||
var resObj = null;
|
var resObj = null;
|
||||||
var errObj = {text: "# oops\nCould not find the homebrew."}
|
var errObj = {text: "# oops\nCould not find the homebrew."}
|
||||||
if(objs.length){
|
if(objs.length){
|
||||||
resObj = objs[0];
|
resObj = objs[0].toJSON();
|
||||||
}
|
}
|
||||||
|
|
||||||
vitreumRender({
|
vitreumRender({
|
||||||
@@ -102,7 +102,7 @@ app.get('/share/:id', function(req, res){
|
|||||||
prerenderWith : './client/homebrew/homebrew.jsx',
|
prerenderWith : './client/homebrew/homebrew.jsx',
|
||||||
initialProps: {
|
initialProps: {
|
||||||
url: req.originalUrl,
|
url: req.originalUrl,
|
||||||
brew : sanitizeBrew(resObj || errObj)
|
brew : sanitizeBrew(resObj.toJSON() || errObj)
|
||||||
},
|
},
|
||||||
clearRequireCache : !process.env.PRODUCTION,
|
clearRequireCache : !process.env.PRODUCTION,
|
||||||
}, function (err, page) {
|
}, function (err, page) {
|
||||||
|
|||||||
Reference in New Issue
Block a user