|
|
@ -9,6 +9,7 @@ import Form from 'react-bootstrap/Form';
|
|
|
|
import Image from 'react-bootstrap/Image';
|
|
|
|
import Image from 'react-bootstrap/Image';
|
|
|
|
import { updateSourceFile } from "typescript";
|
|
|
|
import { updateSourceFile } from "typescript";
|
|
|
|
import { fetchAPI } from "../Fetcher";
|
|
|
|
import { fetchAPI } from "../Fetcher";
|
|
|
|
|
|
|
|
import { fetchPOST } from "../Fetcher";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default function Settings({user} : {user : User}){
|
|
|
|
export default function Settings({user} : {user : User}){
|
|
|
@ -81,7 +82,7 @@ function ProfilSettings({user} : {user : User}) {
|
|
|
|
<Form.Label className="content">Adresse mail</Form.Label>
|
|
|
|
<Form.Label className="content">Adresse mail</Form.Label>
|
|
|
|
<Form.Control ref={emailRef} id="control" size="sm" defaultValue={user.email} type="email" placeholder="Password" />
|
|
|
|
<Form.Control ref={emailRef} id="control" size="sm" defaultValue={user.email} type="email" placeholder="Password" />
|
|
|
|
</Form.Group>
|
|
|
|
</Form.Group>
|
|
|
|
<Button variant="outline-primary" type="button" onClick={() => updateAccountInfos(nameRef.current!.value, emailRef.current!.value)}>Mettre à jour</Button>
|
|
|
|
<Button variant="outline-primary" type="button" onClick={() => updateAccountInfos(nameRef.current!.value, emailRef.current!.value, user)}>Mettre à jour</Button>
|
|
|
|
</Form>
|
|
|
|
</Form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -89,16 +90,11 @@ function ProfilSettings({user} : {user : User}) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function updateAccountInfos(name : string, email : string) {
|
|
|
|
function updateAccountInfos(name : string, email : string, user : User) {
|
|
|
|
fetchAPI("account/update/profile", {
|
|
|
|
fetchAPI("account/update/profile", {
|
|
|
|
name : name,
|
|
|
|
name : name,
|
|
|
|
email : email
|
|
|
|
email : email
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
fetchPOST("account/update", {});
|
|
|
|
|
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// function InputSettings(){
|
|
|
|
|
|
|
|
// return(
|
|
|
|
|
|
|
|
// <div className="input-settings">
|
|
|
|
|
|
|
|
// <p className="title-input-settings">{title}</p>
|
|
|
|
|
|
|
|
// </div>
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// }
|
|
|
|
|