Support updating email via /account/data
This commit is contained in:
parent
5b6f86668a
commit
9e3426633d
3 changed files with 152 additions and 9 deletions
|
|
@ -49,7 +49,7 @@ class AccountController {
|
|||
throw new InvalidRequestError('Password required');
|
||||
}
|
||||
|
||||
const user = await this.accountDB.getUserByName(name);
|
||||
const user = await this.accountDB.getByName(name);
|
||||
|
||||
if (!user) {
|
||||
throw new InvalidRequestError('User does not exist');
|
||||
|
|
|
|||
|
|
@ -104,7 +104,11 @@ class AccountDataRoute {
|
|||
const { password, updates } = req.body;
|
||||
|
||||
try {
|
||||
this.accountController.updateAccount(req.user, updates, password);
|
||||
await this.accountController.updateAccount(
|
||||
req.params.user,
|
||||
updates,
|
||||
password
|
||||
);
|
||||
res.status(204).send();
|
||||
} catch (error) {
|
||||
reportError(req, res, error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue