Closed timarney closed 4 years ago
Update getViewData and getDefaultMiddleware to handle "spreading" the data vs the user doing this in the routes.
Current
app .get(route.path, (req, res) => { const jsFiles = ['js/file-input.js'] res.render(name, { ...routeUtils.getViewData(req), jsFiles }) }) .post(route.path, [ ...routeUtils.getDefaultMiddleware({ schema: Schema, name: name }), ])
Future
app .get(route.path, (req, res) => { const jsFiles = ['js/file-input.js'] const customVars = {jsFiles, othervars: {something: true}} // remove the ...spread_operators from here res.render(name, routeUtils.getViewData(req, customVars)) }) .post(route.path, routeUtils.getDefaultMiddleware({ schema: Schema, name: name }))
Update getViewData and getDefaultMiddleware to handle "spreading" the data vs the user doing this in the routes.
Current
Future