Fixed flow issues
This commit is contained in:
@ -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;
|
||||||
|
@ -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);
|
||||||
|
Reference in New Issue
Block a user