aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHafeez2018-04-13 15:53:10 +0100
committerHafeez2018-04-13 15:53:10 +0100
commit8f013438e4e4c96594b7ed567e7a58dfc1b7ce5a (patch)
treeb370f997c98338925f071a0c802649f08b5ff84c /src
parentdatebase retrieves all properties (diff)
downloadmedicine-8f013438e4e4c96594b7ed567e7a58dfc1b7ce5a.tar.gz
medicine-8f013438e4e4c96594b7ed567e7a58dfc1b7ce5a.zip

fixed mock file tests

Diffstat (limited to 'src')
-rw-r--r--src/FileRouter.ts10
1 files changed, 4 insertions, 6 deletions
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<void> => {
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<void> => {
const file: File | null = await File.findOne({
+ include: [{all: true}],
where: {
uuid: fileId
}