31 lines
772 B
JavaScript
31 lines
772 B
JavaScript
import {restGet, restPost, restPatch, restDelete, restDeleteItem} from "@/rest/restConsumer.js";
|
|
|
|
export async function getAllSchedule(){
|
|
return restGet('/schedules');
|
|
}
|
|
|
|
export async function getOwnSchedule(){
|
|
return restGet('/schedule')
|
|
}
|
|
|
|
export async function createSchedule(curriculum) {
|
|
return restPost('/schedule',{curriculum : curriculum})
|
|
}
|
|
|
|
export async function getCurriculumSchedule(id){
|
|
return restGet('/schedule/curriculum/' + id)
|
|
}
|
|
|
|
export async function addLessonToSchedule(id,lessonId){
|
|
return restPost('/schedule/' + id, lessonId)
|
|
}
|
|
|
|
export async function getSchedule(id){
|
|
return restGet('/schedule/' + id);
|
|
|
|
}
|
|
|
|
export async function deleteLessonFromSchedule(id,lessonId){
|
|
return restDeleteItem('/schedule/lesson/'+ id, lessonId)
|
|
}
|