feat(api): Send flag notifications to slack

This commit is contained in:
Blade Barringer
2016-08-26 22:12:23 -05:00
parent bd5471a0e3
commit 2180cb3d98
5 changed files with 159 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import {
import _ from 'lodash';
import { removeFromArray } from '../../libs/collectionManipulators';
import { getUserInfo, getGroupUrl, sendTxn } from '../../libs/email';
import slack from '../../libs/slack';
import pusher from '../../libs/pusher';
import nconf from 'nconf';
import Bluebird from 'bluebird';
@@ -265,6 +266,12 @@ api.flagChat = {
{name: 'GROUP_URL', content: groupUrl},
]);
slack.sendFlagNotification({
flagger: user,
group,
message,
});
res.respond(200, message);
},
};