mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
wip: get chapters
This commit is contained in:
parent
40496f7ced
commit
c2b3e51ad0
5 changed files with 53 additions and 12 deletions
21
front/services/chapters.ts
Normal file
21
front/services/chapters.ts
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue