From a524845d06a96155d0e5bbb807b62dd8f994650c Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Wed, 6 Mar 2024 19:22:10 +0100 Subject: [PATCH] First draft of the register requests api. I don't think it's currently usable but it serve as a stub for when backend will support it --- frontend/src/rest/ServiceInscription.js | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 frontend/src/rest/ServiceInscription.js diff --git a/frontend/src/rest/ServiceInscription.js b/frontend/src/rest/ServiceInscription.js new file mode 100644 index 0000000..ee75c3b --- /dev/null +++ b/frontend/src/rest/ServiceInscription.js @@ -0,0 +1,35 @@ +/** + * 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 } 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 + */ +export async function getRegisters(){ + return restGet("/requests/register") +} + +/** + * Get info on a particular registering request + */ +export async function getRegisters(id){ + return restGet("/requests/register/" + id); +} + +/** + * Change the state of a requests. + */ +export async function validateRegister(id, state){ + return restPost("/requests/register/" + id, {state: state}); +}