aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHafeez2018-04-15 19:44:38 +0100
committerHafeez2018-04-15 19:44:38 +0100
commitacd2cd460ef781ba5ae37d579ac984ca4ee1948c (patch)
treee47d640642ad82c0f2231018f206484e222424bd
parentMerge branch 'trh/gets' of gitlab.cs.st-andrews.ac.uk:cs3099group-be-4/projec... (diff)
downloadmedicine-acd2cd460ef781ba5ae37d579ac984ca4ee1948c.tar.gz
medicine-acd2cd460ef781ba5ae37d579ac984ca4ee1948c.zip

file upload works, i thnk

-rw-r--r--src/FileRouter.ts22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/FileRouter.ts b/src/FileRouter.ts
index d6cea53..9a7dcac 100644
--- a/src/FileRouter.ts
+++ b/src/FileRouter.ts
@@ -575,19 +575,8 @@ const postFilePath: Middleware = (
name: res.locals.filename,
parentFolder: res.locals.parentFolder
});
- console.log(res.locals);
- /*
- console.log("1: " + file.uuid + " -- " + res.locals.project.name)
- try {
- let x = files.writableStream(file.uuid, res.locals.project.name);
- console.log("2")
- req.pipe(x);
- console.log("3")
- } catch (err) {
- console.log(err);
- }
- console.log("4")
- */
+ //console.log(res.locals);
+ req.pipe(files.writableStream(file.uuid, res.locals.project.name));
next();
};
@@ -714,13 +703,14 @@ export class FileRouter {
}
const parentFolder: File | null = await File.findOne({
include: [
- { model: File, as: 'containedFiles' }
+ { model: File, as: 'containedFilesInternal'},
],
where: {
- parentFolder: file,
- name: fileNames[0]
+ //parentFolder: file,
+ //name: fileNames[0]
}
});
+ //console.log(parentFolder);
if (parentFolder == null) {
return next();
}