feat: forward org_id values for lectures

This commit is contained in:
swve 2023-03-22 22:54:28 +01:00
parent 98b470f2ab
commit 447ac93649
6 changed files with 75 additions and 67 deletions

View file

@ -1,13 +1,13 @@
import { getAPIUrl } from "@services/config";
import { RequestBody, RequestBodyForm } from "@services/utils/requests";
export async function createLecture(data: any, chapter_id: any) {
export async function createLecture(data: any, chapter_id: any, org_id: any) {
data.content = {};
// remove chapter_id from data
delete data.chapterId;
const result: any = await fetch(`${getAPIUrl()}lectures/?coursechapter_id=${chapter_id}`, RequestBody("POST", data))
const result: any = await fetch(`${getAPIUrl()}lectures/?coursechapter_id=${chapter_id}&org_id=${org_id}`, RequestBody("POST", data))
.then((result) => result.json())
.catch((error) => console.log("error", error));