From 8f013438e4e4c96594b7ed567e7a58dfc1b7ce5a Mon Sep 17 00:00:00 2001 From: Hafeez Date: Fri, 13 Apr 2018 15:53:10 +0100 Subject: fixed mock file tests --- src/FileRouter.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/FileRouter.ts b/src/FileRouter.ts index 619be9e..b76dea7 100644 --- a/src/FileRouter.ts +++ b/src/FileRouter.ts @@ -415,13 +415,10 @@ const getProjects: Middleware = const getProjectName: Middleware = async(req: Request, res: Response, next: NextFunction): Promise => { const project: Project | null = res.locals.project; - if (project == null) { - console.log("was null") + if (project == null) { return next(new RequestError(404, 'project_not_found')); - } else { - console.log(project.contributors); - res.locals.data = project.fullInfo; - console.log("wasnt " + res.locals.data) + } else { + res.locals.data = project.fullInfo; next(); } }; @@ -639,6 +636,7 @@ export class FileRouter { fileId: string ): Promise => { const file: File | null = await File.findOne({ + include: [{all: true}], where: { uuid: fileId } -- cgit v1.2.1