mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
21 lines
614 B
TypeScript
21 lines
614 B
TypeScript
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;
|
|
}
|