1
0
forked from PGL/Clyde
Clyde/frontend/src/rest/ServiceInscription.js
LeoMoulin 4199663d64 Huge commit
- Rework the inscription requests system so that it considers the equivalence systems and the impact of the teacher in the inscription procedure.
2024-04-11 16:45:48 +02:00

47 lines
1.0 KiB
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, 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("/request/register");
}
/**
* list all register request in a list of Objects
* Shall return a list of
* - id
* - type
* - lastName
* - firstName
* - address
* - country
* - birthdate
* - email
* - curriculum
* - degree
*/
export async function getRegisters(id){
if(id != null)
return restGet("/request/register/" + id);
return restGet("/request/register")
}
export async function getAllRegisters(){
return restGet("/requests/register")
}
/**
* Change the state of a requests.
*/
export async function validateRegister(id, state){
return restPatch("/request/register/" + id, state);
}