Clyde/frontend/src/rest/LessonRequests.js
2024-04-19 21:29:45 +02:00

23 lines
686 B
JavaScript

import { restGet, restPost, restDelete, restPatch } from './restConsumer.js'
export async function getLessonRequest(id){
return restGet('/requests/lessonRequest/' + id);
}
export async function getAllRequests(){
return restGet("/requests/lessonRequests");
}
export async function getOwnedRequests(){
return restGet("/requests/lessonRequests/owned");
}
export async function createRequest(request){
return restPost("/requests/lessonRequest", request);
}
export async function changeRequestState(id, infos){
return restPatch("/requests/lessonRequest/" + id, infos);
}
export async function deleteRequest(id){
return restDelete("/requests/lessonRequest/"+id);
}