manage Course finished
This commit is contained in:
@ -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
|
||||
|
@ -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} )
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user