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

Quick fix to an incredibly large payload size on the admin page

This commit is contained in:
Scott
2016-02-19 22:09:19 -05:00
parent 0a8c489132
commit 256e62095c
2 changed files with 9 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
'use strict';
var _ = require('lodash');
require('app-module-path').addPath('./shared');
var vitreumRender = require('vitreum/render');
var bodyParser = require('body-parser')
@@ -38,6 +39,13 @@ app.get('/admin', function(req, res){
return res.status(401).send('Access denied')
}
HomebrewModel.find({}, function(err, homebrews){
//Remove the text to reduce the response payload
homebrews = _.map(homebrews, (brew)=>{
brew.text = brew.text != '';
return brew;
});
vitreumRender({
page: './build/admin/bundle.dot',
prerenderWith : './client/admin/admin.jsx',