manage Course finished

This commit is contained in:
2024-03-18 14:51:27 +01:00
parent 92079c5a47
commit 0871d2971d
27 changed files with 22 additions and 19 deletions

View File

@ -3,7 +3,7 @@
*
* TODO: On time of writing, the backend doesn't support these endpoints so it could be modified in the future.
*/
import {restGet, restPatch,restPatchInfo} from './restConsumer.js'
import {restGet, restPatch} from './restConsumer.js'
/**
* create a new register requests that can be recovered by the registering service

View File

@ -7,8 +7,10 @@ import { restGet, restPost, restDelete, restPatch } from './restConsumer.js'
/**
* Create a new course
*/
export async function createCourse(name, credits, teacher){
return restPost("/course", {title: name, credits: credits, owner: teacher} )
export async function createCourse(name, credits, owner){
console.log(owner);
return restPost("/course", {title: name, credits: credits, owner} )
}
/**

View File

@ -11,7 +11,6 @@ export async function restPost(endPoint, data) {
return await _rest(endPoint, {method: "POST", credentials: 'include', body: JSON.stringify(data)});
}
export async function restPostFile(endPoint, file){
let headers = new Headers();
return await _rest(endPoint, {method: "POST", credentials: 'include', body: file, headers: headers });
@ -25,10 +24,6 @@ export async function restPatch(endPoint, data) {
return await _rest(endPoint, {method: "PATCH", credentials: 'include', body: JSON.stringify(data)});
}
export async function restPatchInfo(endPoint, data){
return await _rest(endPoint, {method: "PATCH", credentials: 'include', body: data});
}
/**
* backbone for the request made by the frontend
*