wip: get chapters

This commit is contained in:
swve 2022-10-31 18:08:38 +01:00
parent 40496f7ced
commit c2b3e51ad0
5 changed files with 53 additions and 12 deletions

View file

@ -0,0 +1,21 @@
import { initialData } from "../components/drags/data";
import { getAPIUrl } from "./config";
export async function getCourseChaptersMetadata(course_id: any) {
const HeadersConfig = new Headers({ "Content-Type": "application/json" });
const requestOptions: any = {
method: "GET",
headers: HeadersConfig,
redirect: "follow",
credentials: "include",
};
const data: any = await fetch(`${getAPIUrl()}chapters/meta/course_${course_id}`, requestOptions)
.then((result) => result.json())
.catch((error) => console.log("error", error));
console.log("data", data);
return data;
}