[chore] added prettier

This commit is contained in:
Jori Lallo
2017-04-26 21:47:03 -07:00
parent fcdeb67bc5
commit 08b1609440
53 changed files with 1983 additions and 928 deletions

View File

@ -4,17 +4,14 @@ import { Document, User } from '../models';
const router = new Router();
router.post('hooks.slack', async (ctx) => {
const {
token,
user_id,
text,
} = ctx.body;
router.post('hooks.slack', async ctx => {
const { token, user_id, text } = ctx.body;
ctx.assertPresent(token, 'token is required');
ctx.assertPresent(user_id, 'user_id is required');
ctx.assertPresent(text, 'text is required');
if (token !== process.env.SLACK_VERIFICATION_TOKEN) throw httpErrors.BadRequest('Invalid token');
if (token !== process.env.SLACK_VERIFICATION_TOKEN)
throw httpErrors.BadRequest('Invalid token');
const user = await User.find({
where: {
@ -31,7 +28,9 @@ router.post('hooks.slack', async (ctx) => {
const results = [];
let number = 1;
for (const document of documents) {
results.push(`${number}. <${process.env.URL}${document.getUrl()}|${document.title}>`);
results.push(
`${number}. <${process.env.URL}${document.getUrl()}|${document.title}>`
);
number += 1;
}