Skip to content

Commit

Permalink
quick route to reload the announcements from slack
Browse files Browse the repository at this point in the history
  • Loading branch information
hemangandhi committed Oct 14, 2017
1 parent fa3dce9 commit 8d398b2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions main/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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])));
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 8d398b2

Please sign in to comment.