post User by secretary
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user