Register API and form optimization [depend: backend /register] #93
@ -7,18 +7,17 @@ export async function login(user, pass, exp){
|
||||
/**
|
||||
* Register a user (tokenless)
|
||||
*
|
||||
* @param data object containing info about the user
|
||||
*
|
||||
* - firstname
|
||||
* - lastname
|
||||
* - birthdate
|
||||
* - password
|
||||
* - mail
|
||||
* - address
|
||||
* - country
|
||||
* - cursus
|
||||
* @param firstname
|
||||
* @param lastname
|
||||
* @param birthdate
|
||||
* @param password
|
||||
* @param mail
|
||||
* @param address
|
||||
* @param country
|
||||
* @param cursus
|
||||
* @param imageId id of the image in database returned when uploaded
|
||||
*/
|
||||
export async function register(firstname, lastname, birthDate, password, email, address, country, cursus){
|
||||
export async function register(firstname, lastname, birthDate, password, email, address, country, cursus, imageId){
|
||||
return restPost("/register", {
|
||||
Maxime marked this conversation as resolved
|
||||
firstname: firstname,
|
||||
lastname: lastname,
|
||||
@ -34,21 +33,19 @@ export async function register(firstname, lastname, birthDate, password, email,
|
||||
/**
|
||||
* Register a user (by secretary)
|
||||
*
|
||||
* @param data object containing info about the user
|
||||
*
|
||||
* - firstname
|
||||
* - lastname
|
||||
* - birthdate
|
||||
* - password
|
||||
* - mail
|
||||
* - address
|
||||
* - country
|
||||
* - cursus
|
||||
* @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 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, cursus, role){
|
||||
export async function createUser(firstname, lastname, birthDate, email, address, country, role, imageId){
|
||||
return restPost("/user", {
|
||||
firstname: firstname,
|
||||
lastname: lastname,
|
||||
Maxime
commented
pas necessairement de cursus, surtout dans le cadre où le secrétariat postent les teachers (surtout que les users on pas de cursus) pas necessairement de cursus, surtout dans le cadre où le secrétariat postent les teachers
(surtout que les users on pas de cursus)
|
||||
@ -57,7 +54,6 @@ export async function createUser(firstname, lastname, birthDate, email, address,
|
||||
email: email,
|
||||
address: address,
|
||||
country: country,
|
||||
cursus:cursus
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user
ProfilePictureUrl pas présent ?
car de mémoire tu postais l'image directe je te retournais l'URL comme ça tu la postais
c'est parce que j'avais fait ça avant qu'on parle des pp 👉👈
@Maxime Le problème c'est que si tu me retourne l'url tu vas pas pouvoir le lier à la db
faudrait du coup me retourner l'id que je te retourne. Ce qui n'est pas ouf non plus mais bon. en vrai autant ne pas trop se casser la tête