Skip to content

Commit 1772b57

Browse files
committed
fix: Password update bug
1 parent c72e59a commit 1772b57

File tree

4 files changed

+32
-27
lines changed

4 files changed

+32
-27
lines changed

client/public/static/i18n/en/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"home": "Home",
3+
"account": "Account",
34
"userList": "User list",
45
"Examples": "Examples",
56
"giveAdminRights": "Give admin rights",

client/public/static/i18n/fr/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"home": "Accueil",
3+
"account": "Compte",
34
"userList": "Utilisateurs",
45
"Examples": "Exemples",
56
"giveAdminRights": "Donner les droits admin",
Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
11
import { Container, Grid } from '@mui/material';
22
import React from 'react';
3+
import { useTranslation } from 'react-i18next';
34
import Page from '../../../components/Page';
45
import Profile from './Profile';
56
import ProfileDetails from './ProfileDetails';
67

7-
const Account = () => (
8-
<Page
9-
title="Account"
10-
>
11-
<Container maxWidth="lg">
12-
<Grid
13-
container
14-
spacing={3}
15-
>
16-
<Grid
17-
item
18-
lg={4}
19-
md={6}
20-
xs={12}
21-
>
22-
<Profile />
23-
</Grid>
8+
const Account = () => {
9+
const { t } = useTranslation();
10+
11+
return (
12+
<Page title={t('account')}>
13+
<Container maxWidth="lg">
2414
<Grid
25-
item
26-
lg={8}
27-
md={6}
28-
xs={12}
15+
container
16+
spacing={3}
2917
>
30-
<ProfileDetails />
18+
<Grid
19+
item
20+
lg={4}
21+
md={6}
22+
xs={12}
23+
>
24+
<Profile />
25+
</Grid>
26+
<Grid
27+
item
28+
lg={8}
29+
md={6}
30+
xs={12}
31+
>
32+
<ProfileDetails />
33+
</Grid>
3134
</Grid>
32-
</Grid>
33-
</Container>
34-
</Page>
35-
);
35+
</Container>
36+
</Page>
37+
);
38+
};
3639

3740
export default Account;

server/src/controllers/Users.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const changePassword = (prisma: PrismaClient) => async (
103103
const user = await auth(prisma, req);
104104

105105
const userToUpdate = await prisma.user.findUniqueOrThrow({
106-
where: { id: user.id },
106+
where: { id },
107107
});
108108

109109
// Check if user is self or admin

0 commit comments

Comments
 (0)