Fixed flow issues

This commit is contained in:
Jori Lallo
2017-06-27 20:36:09 -07:00
parent f8a715dcef
commit b6fa0a4a4e
2 changed files with 3 additions and 1 deletions

View File

@ -17,12 +17,14 @@ class Document {
html: string; html: string;
id: string; id: string;
private: boolean; private: boolean;
starred: boolean;
team: string; team: string;
text: string; text: string;
title: string; title: string;
updatedAt: string; updatedAt: string;
updatedBy: User; updatedBy: User;
url: string; url: string;
views: number;
client: ApiClient; client: ApiClient;
errors: ErrorsStore; errors: ErrorsStore;

View File

@ -3,7 +3,7 @@ import apiError from '../../errors';
import validator from 'validator'; import validator from 'validator';
export default function validation() { export default function validation() {
return function validationMiddleware(ctx, next) { return function validationMiddleware(ctx: Object, next: Function) {
ctx.assertPresent = function assertPresent(value, message) { ctx.assertPresent = function assertPresent(value, message) {
if (value === undefined || value === null || value === '') { if (value === undefined || value === null || value === '') {
throw apiError(400, 'validation_error', message); throw apiError(400, 'validation_error', message);