Some checks failed
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test backend / Build-backend (push) Successful in 2m14s
Build and test backend / Test-backend (push) Successful in 1m17s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Has been cancelled
This commit is waiting for the backend implementation to be merged. The list of field expected is writen in comment
42 lines
970 B
JavaScript
42 lines
970 B
JavaScript
/**
|
|
* functions to handle register requests.
|
|
*
|
|
* TODO: On time of writing, the backend doesn't support these endpoints so it could be modified in the future.
|
|
*/
|
|
import { restGet, restPost } from './restConsumer.js'
|
|
|
|
/**
|
|
* create a new register requests that can be recovered by the registering service
|
|
* TODO: add info in the Object (I don't know what will be needed)
|
|
*/
|
|
export async function createRegister(){
|
|
return restPost("/requests/register");
|
|
}
|
|
|
|
/**
|
|
* list all register request in a list of Objects
|
|
* Shall return a list of
|
|
* - id
|
|
* - type
|
|
* - lastName
|
|
* - firstName
|
|
* - address
|
|
* - country
|
|
* - birthdate
|
|
* - email
|
|
* - cursus
|
|
* - degree
|
|
*/
|
|
export async function getRegisters(id){
|
|
if(id != null)
|
|
return restGet("/requests/register/" + id);
|
|
return restGet("/requests/register")
|
|
}
|
|
|
|
/**
|
|
* Change the state of a requests.
|
|
*/
|
|
export async function validateRegister(id, state){
|
|
return restPost("/requests/register/" + id, {state: state});
|
|
}
|