diff options
| author | jw255 | 2018-04-16 16:08:24 +0100 |
|---|---|---|
| committer | jw255 | 2018-04-16 16:08:24 +0100 |
| commit | 61f82a24779b7c78ac501f92fe78392cb9972912 (patch) | |
| tree | e6aa9ef3198d3eae1933d133425804052b965ef2 | |
| parent | nothing major (diff) | |
| parent | precondition files works (diff) | |
| download | medicine-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
| -rw-r--r-- | src/FileRouter.ts | 9 |
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); |
