aboutsummaryrefslogtreecommitdiff
path: root/src/FileRouter.ts
diff options
context:
space:
mode:
authorjw2552018-04-16 16:08:24 +0100
committerjw2552018-04-16 16:08:24 +0100
commit61f82a24779b7c78ac501f92fe78392cb9972912 (patch)
treee6aa9ef3198d3eae1933d133425804052b965ef2 /src/FileRouter.ts
parentnothing major (diff)
parentprecondition files works (diff)
downloadmedicine-61f82a24779b7c78ac501f92fe78392cb9972912.tar.gz
medicine-61f82a24779b7c78ac501f92fe78392cb9972912.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/FileRouter.ts')
-rw-r--r--src/FileRouter.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/FileRouter.ts b/src/FileRouter.ts
index f7a1809..70243c3 100644
--- a/src/FileRouter.ts
+++ b/src/FileRouter.ts
@@ -575,7 +575,7 @@ const postFilePath: Middleware = (
name: res.locals.filename,
parentFolder: res.locals.parentFolder
});
- //console.log(res.locals);
+ //console.log(res.locals);
req.pipe(files.writableStream(file.uuid, res.locals.project.name));
next();
};
@@ -702,13 +702,16 @@ export class FileRouter {
}
fileNames.splice(0, 1);
}
+ if (file == null) {
+ return next();
+ }
const parentFolder: File | null = await File.findOne({
include: [
{ model: File, as: 'containedFilesInternal'}
],
where: {
- //parentFolder: file,
- //name: fileNames[0]
+ parentFolderId: file.id,
+ name: fileNames[0]
}
});
//console.log(parentFolder);