aboutsummaryrefslogtreecommitdiff
path: root/src/FileRouter.ts
diff options
context:
space:
mode:
authorcjd242018-04-23 15:32:02 +0100
committercjd242018-04-23 15:32:02 +0100
commit3987d5068881341c27150e37eff1794a27901cac (patch)
tree6165dff18f9f0a31e4eecec056d264732f99bdd0 /src/FileRouter.ts
parentPANIC COMMITS OMMGGGGG (diff)
parentALL TESTS FIXXXXXXXED (diff)
downloadmedicine-3987d5068881341c27150e37eff1794a27901cac.tar.gz
medicine-3987d5068881341c27150e37eff1794a27901cac.zip

merge conflict

Diffstat (limited to 'src/FileRouter.ts')
-rw-r--r--src/FileRouter.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/FileRouter.ts b/src/FileRouter.ts
index e977073..de75ded 100644
--- a/src/FileRouter.ts
+++ b/src/FileRouter.ts
@@ -589,7 +589,7 @@ const postProjectName: Middleware = async(
if (project == null) {
logger.debug('Adding new project');
const file: File = new File({
- uuid: uuid.generate(),
+ uuid: uuid.generate()
});
file.mimetype = 'inode/directory';
file.name = '';
@@ -662,9 +662,7 @@ const getFileFromPath: (req: Request, res: Response) => Promise<void> = async(
}
return j;
};
-
const path: string = req.path.substring(nth(req.path, '/', 4) + 1);
-
res.locals.path = path;
logger.debug(`Searching for path '${res.locals.path}'`);
// Split path into parts
@@ -674,7 +672,7 @@ const getFileFromPath: (req: Request, res: Response) => Promise<void> = async(
? fileNames[fileNames.length - 1]
: '';
const project: Project | null = res.locals.project;
- if (project == null) {
+ if (!project) {
// Project should have been found by previous precondition
logger.debug('Project was not found: skipping finding file');
throw new RequestError(404, 'project_not_found');
@@ -1117,6 +1115,6 @@ export class FileRouter {
}
// Create the FileRouter, and export its configured Express.Router
-const fileRoutes: FileRouter = new FileRouter();
+//const fileRoutes: FileRouter = new FileRouter();
-export default fileRoutes.router;
+export default new FileRouter().router;