From 3bbe77f5f09da102142b04388b7e289547a4c339 Mon Sep 17 00:00:00 2001 From: Avris Date: Fri, 16 Oct 2020 23:46:49 +0200 Subject: [PATCH] #50 [card] pronoun cards - api fixes --- server/user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/user.js b/server/user.js index 8ce0a795..ab043567 100644 --- a/server/user.js +++ b/server/user.js @@ -166,15 +166,15 @@ export default async function (req, res, next) { const user = authenticate(req); if (req.method === 'POST' && req.url === '/init' && req.body.usernameOrEmail) { - return renderJson(await init(db, req.body.usernameOrEmail)); + return renderJson(res, await init(db, req.body.usernameOrEmail)); } if (req.method === 'POST' && req.url === '/validate' && req.body.code) { - return renderJson(await validate(db, user, req.body.code)); + return renderJson(res, await validate(db, user, req.body.code)); } if (req.method === 'POST' && req.url === '/change-username' && user && user.authenticated && req.body.username) { - return renderJson(await changeUsername(db, user, req.body.username)); + return renderJson(res, await changeUsername(db, user, req.body.username)); } return renderJson(res, {error: 'Not found'}, 404);