post User by secretary

This commit is contained in:
2024-04-21 23:14:56 +02:00
parent 608b6e4893
commit 1a266cdfbd
10 changed files with 208 additions and 90 deletions

View File

@ -13,6 +13,10 @@ export function disconnect(){
setCookie("session_token", ";expires= Thu, 01 Jan 1970 00:00:01 GMT")
}
export async function patchUser(id,data){
return restPatch("/user/" +id, data)
}
/**
* Register a user (tokenless)
*
@ -43,31 +47,8 @@ export async function register(firstname, lastname, birthDate, password, email,
});
}
/**
* Register a user (by secretary)
*
* @param firstname
* @param lastname
* @param birthdate
* @param password
* @param mail
* @param address
* @param country
* @param imageId id of the image in database returned when uploaded
*
* PS: the password is not required as it is generated by the backend and sent to the user
* by mail. it's up to the user to change it if he cares about security
*/
export async function createUser(firstname, lastname, birthDate, email, address, country, role, imageId){
return restPost("/user", {
firstname: firstname,
lastname: lastname,
birthDate: birthDate,
password: password,
email: email,
address: address,
country: country,
});
export async function postUser(data){
return restPost("/user", data)
}
/**