trop de truc
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m58s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s

This commit is contained in:
2024-03-17 21:38:10 +01:00
32 changed files with 521 additions and 307 deletions

View File

@ -7,8 +7,8 @@ import { restGet, restPost, restDelete, restPatch } from './restConsumer.js'
/**
* Create a new course
*/
export async function createCourse(name, credits, faculty, teacher, assistants){
return restPost("/courses", {name: name, credits: credits, faculty: faculty, teacher: teacher, assistants: assistants} )
export async function createCourse(name, credits, teacher){
return restPost("/course", {name: name, credits: credits, owner: teacher} )
}
/**
@ -45,10 +45,14 @@ export async function getCourse(id){
* - teacher
* - Assistants
*/
export async function getCourses(){
return restGet("/course")
export async function getCourses(role){
if(role==="Teacher"){
return restGet("/courses/owned")
}
return restGet("/courses")
}
/**
* Change the options of a course
*