From 8d398b2ff78d3c4646dc8c18e549c7f10bed484d Mon Sep 17 00:00:00 2001 From: hemangandhi Date: Sat, 14 Oct 2017 09:52:45 -0400 Subject: [PATCH] quick route to reload the announcements from slack --- main/routes.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/main/routes.js b/main/routes.js index 1b227f3..04cca96 100755 --- a/main/routes.js +++ b/main/routes.js @@ -4,6 +4,7 @@ const path = require('path'); const express = require('express'); const Waitlist = require('../models/waitlist.js'); const EmailClient = require('./email.js'); +const loadMsgs = require('./loadmsgs.js'); const config = require('../config/config.js'); const React = require('react'); const ReactDOMServer = require('react-dom/server'); @@ -111,8 +112,6 @@ const aggregateUserData = function aggregateUserData(filters, queries, then) { if(filters === undefined){ currObj = [currObj[1]]; } - console.log("Ross John Brown"); - console.log(JSON.stringify(currObj, null, 4)); User.aggregate(currObj, (err, newData) => inner(idx + 1, data.concat([newData]))); @@ -605,6 +604,16 @@ const init = function RouteHandler(app, config, passport, upload) { return res.redirect('/'); }); + app.get('/reload-msgs', (req, res) => { + if(!req.user || !req.user.role.admin){ + res.redirect('/dashboard'); + return; + } + + loadMsgs.loadMsgs(); + res.send('Success'); + }); + app.get('/all-the-data', (req, res) => { if(!req.user || !req.user.role.admin){ res.redirect('/dashboard');