Adding info about self #88

Merged
tonitch merged 3 commits from tonitch/front/userSelf into master 2024-03-13 09:54:57 +01:00

View File

@ -18,6 +18,25 @@ export async function getUser(id){
return restGet(endpoint); return restGet(endpoint);
} }
/**
* Alterable datas of user.
* usage by secretary
*
* @param id regno of the user
* @param data data to change
*
* - lastName
* - firstName
* - birthDate
* - role
* - email
* - photo
* - Adress
*/
export async function alterUser(id, data){
return restPatch("/user/" + id, data);
}
/** /**
* Reserved for secretary roles. Allow to list all user on the plateform * Reserved for secretary roles. Allow to list all user on the plateform
*/ */
@ -25,3 +44,27 @@ export async function getAllUsers(){
return restGet("/users"); return restGet("/users");
} }
/**
* Get informations about yourself
* - RegNo
* - FirstName / LastName
* - email
* - adressId (?)
* - birthDate
* - role
*/
export async function getSelf(){
return restGet("/user");
}
/**
* Alterable datas are
tonitch marked this conversation as resolved
Review

on ne peut donc pas changer son mdp ?

on ne peut donc pas changer son mdp ?
Review

si j'ai oublié ^^

si j'ai oublié ^^
* - email
* - photo
* - Adress
* - Password
*/
export async function alterSelf(data){
return restPatch("/user", data);
}