mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Remove snake_case.
This commit is contained in:
parent
e1f99a7d01
commit
a91386434d
21 changed files with 86 additions and 100 deletions
|
|
@ -17,8 +17,8 @@ export interface UserPasswordRequestQuery {
|
|||
}
|
||||
|
||||
export interface UserPasswordRequestBody {
|
||||
current_password: string;
|
||||
new_password: string;
|
||||
currentPassword: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
export default async (
|
||||
|
|
@ -27,7 +27,7 @@ export default async (
|
|||
) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
const { current_password, new_password } = req.body;
|
||||
const { currentPassword, newPassword } = req.body;
|
||||
const { id } = req.query;
|
||||
const {
|
||||
user: { id: userId, isAdmin },
|
||||
|
|
@ -40,11 +40,11 @@ export default async (
|
|||
|
||||
const user = await getUser({ id }, { includePassword: true });
|
||||
|
||||
if (!checkPassword(current_password, user.password)) {
|
||||
if (!checkPassword(currentPassword, user.password)) {
|
||||
return badRequest(res, 'Current password is incorrect');
|
||||
}
|
||||
|
||||
const password = hashPassword(new_password);
|
||||
const password = hashPassword(newPassword);
|
||||
|
||||
const updated = await updateUser({ password }, { id });
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue