aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjw2552018-04-13 16:10:57 +0100
committerjw2552018-04-13 16:10:57 +0100
commitcfcce63363156b5b2a8c5b4befba4babf2266f6a (patch)
tree8771ec4e9f4587efc765496c73bdde35d8cd2bf6 /src
parentfixed some privs (diff)
parentfixed mock file tests (diff)
downloadmedicine-cfcce63363156b5b2a8c5b4befba4babf2266f6a.tar.gz
medicine-cfcce63363156b5b2a8c5b4befba4babf2266f6a.zip

Merge branch ‘trh/gets’ of https://gitlab.cs.st-andrews.ac.uk/cs3099group-be-4/project-code into trh/gets

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 7db7eb2..b7542c4 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();
}
};
@@ -640,6 +637,7 @@ export class FileRouter {
fileId: string
): Promise<void> => {
const file: File | null = await File.findOne({
+ include: [{all: true}],
where: {
uuid: fileId
}