Clyde/frontend/src/rest/ServiceInscription.js
Bartha Maxime 2ea6ed16bb
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m6s
Build and test backend / Test-backend (pull_request) Successful in 2m2s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
removed missclick
2024-03-15 18:53:58 +01:00

42 lines
966 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, restPatch} 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("/request/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("/request/register/" + id);
return restGet("/request/register")
}
/**
* Change the state of a requests.
*/
export async function validateRegister(id, state){
return restPatch("/request/register/" + id, {state: state});
}