chore(): rename website/src -> website/server and website/public -> website/client (#7199)

This commit is contained in:
Matteo Pagliazzi
2016-05-13 15:35:12 +02:00
parent 486b93a3c9
commit 199732539f
504 changed files with 202 additions and 202 deletions
+31
View File
@@ -0,0 +1,31 @@
import { each } from 'lodash';
import { post } from 'request';
import { isURL } from 'validator';
import logger from './logger';
let _sendWebhook = (url, body) => {
post({
url,
body,
json: true,
}, (err) => logger.error(err));
};
let _isInvalidWebhook = (hook) => {
return !hook.enabled || !isURL(hook.url);
};
export function sendTaskWebhook (webhooks, data) {
each(webhooks, (hook) => {
if (_isInvalidWebhook(hook)) return;
let body = {
direction: data.task.direction,
task: data.task.details,
delta: data.task.delta,
user: data.user,
};
_sendWebhook(hook.url, body);
});
}