trop de truc
This commit is contained in:
@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user