added previous name to log

This commit is contained in:
Jack 2021-10-21 00:36:11 +01:00
parent ba493b2009
commit 6e2a680388

View file

@ -47,8 +47,13 @@ class UserController {
message:
"Username invalid. Name cannot contain special characters or contain more than 14 characters. Can include _ . and -",
});
let olduser = await UsersDAO.getUser(uid);
await UsersDAO.updateName(uid, name);
Logger.log("user_name_updated", `changed name to ${name}`, uid);
Logger.log(
"user_name_updated",
`changed name from ${olduser.name} to ${name}`,
uid
);
return res.sendStatus(200);
} catch (e) {
return next(e);