Clyde/frontend/src/rest/ServiceInscription.js
Bartha Maxime 1bff48a4b9 changed the frontend API calls
to better suit the backend and logic (register => list and register => single item)
2024-03-15 17:09:18 +01:00

36 lines
899 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
*/
export async function getRegisters(){
return restGet("/requests/register")
}
/**
* Get info on a particular registering request
*/
export async function getRegisters(id){
return restGet("/request/register/" + id);
}
/**
* Change the state of a requests.
*/
export async function validateRegister(id, state){
return restPatch("/request/register/" + id, {state: state});
}