aboutsummaryrefslogtreecommitdiff
path: root/src/FileRouter.ts
diff options
context:
space:
mode:
authorjosh97josh2018-04-16 18:03:59 +0100
committerjosh97josh2018-04-16 18:03:59 +0100
commitfbef411bb1a0987a753024fc7822683fd3dc1df8 (patch)
tree319a222ae9e49a2ca666413e2a98208107ee1e7b /src/FileRouter.ts
parentfile upload works, i thnk (diff)
downloadmedicine-fbef411bb1a0987a753024fc7822683fd3dc1df8.tar.gz
medicine-fbef411bb1a0987a753024fc7822683fd3dc1df8.zip

minor errors fixed

Diffstat (limited to 'src/FileRouter.ts')
-rw-r--r--src/FileRouter.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/FileRouter.ts b/src/FileRouter.ts
index 9a7dcac..ff8f5c1 100644
--- a/src/FileRouter.ts
+++ b/src/FileRouter.ts
@@ -367,6 +367,7 @@ const postCurUser: Middleware = async(
const postUsername: Middleware = async(
req: Request, res: Response, next: NextFunction
): Promise<void> => {
+ //if (req.query.action === 'create')
let user: User | null | undefined = res.locals.user;
res.locals.modified = true;
if (user == null) {
@@ -382,6 +383,7 @@ const postUsername: Middleware = async(
if (req.body) {
user.metadata = req.body;
}
+ await user.save()
next();
};