Skip to content
Snippets Groups Projects
Commit 872c6021 authored by CERDAN BAPTISTE's avatar CERDAN BAPTISTE
Browse files

Merge branch 'develop' into 'main'

:sparkles: add picture modify

See merge request !11
parents abc5d49c 78175772
1 merge request!11:sparkles: add picture modify
Pipeline #69015 passed with stage
......@@ -105,6 +105,7 @@ router.post('/me/update', passport.authenticate('jwt', {session: false}), async
const date_birth = req.body.date_birth;
const oldPassword = req.body.oldpassword;
const newPassword = req.body.password;
const newPicture= req.body.picture;
if (!firstname && !lastname && !email && !date_birth && !passport)
return res.status(200);
......@@ -135,6 +136,8 @@ router.post('/me/update', passport.authenticate('jwt', {session: false}), async
dbUser.email = email;
if (date_birth)
dbUser.date_birth = date_birth;
if (newPicture)
dbUser.picture = newPicture;
try {
await dbUser.save();
......
......@@ -150,6 +150,15 @@ export class Profile extends React.Component {
/>
</Form.Group>
}
<Form.Group controlId="picture">
<Form.Label>Avatar</Form.Label>
<Form.Control
defaultValue={this.props.state.me.picture}
onChange={this.handleChange}
type="text"
readOnly={this.state.readOnly}
/>
</Form.Group>
{ !this.state.readOnly &&
<Button
block
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment