aboutsummaryrefslogtreecommitdiff
path: root/src/FileRouter.ts
diff options
context:
space:
mode:
authorHafeez2018-04-16 16:07:21 +0100
committerHafeez2018-04-16 16:07:21 +0100
commita41380c2ab3b06dd78f61f723f83b84a386b83a8 (patch)
tree01e7dab0619b58c8a208437841c4b95aa66e8421 /src/FileRouter.ts
parentfile upload works, i thnk (diff)
downloadmedicine-a41380c2ab3b06dd78f61f723f83b84a386b83a8.tar.gz
medicine-a41380c2ab3b06dd78f61f723f83b84a386b83a8.zip

precondition files works

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 9a7dcac..f941dd6 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();
};
@@ -701,13 +701,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);