Lint rules and flow annotations for rest of the files
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
function present(ctx, key) {
|
||||
// @flow
|
||||
import { type Context } from 'koa';
|
||||
import { ApiKey } from '../models';
|
||||
|
||||
function present(ctx: Context, key: ApiKey) {
|
||||
return {
|
||||
id: key.id,
|
||||
name: key.name,
|
||||
|
||||
@@ -8,8 +8,8 @@ function present(ctx: Object, user: User) {
|
||||
id: user.id,
|
||||
username: user.username,
|
||||
name: user.name,
|
||||
avatarUrl: user.avatarUrl ||
|
||||
(user.slackData ? user.slackData.image_192 : null),
|
||||
avatarUrl:
|
||||
user.avatarUrl || (user.slackData ? user.slackData.image_192 : null),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import presentUser from './user';
|
||||
|
||||
import ctx from '../../__mocks__/ctx';
|
||||
|
||||
it('presents a user', async () => {
|
||||
|
||||
Reference in New Issue
Block a user