mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: implement youtube backend and partial front
This commit is contained in:
parent
cdd1ca46d3
commit
77d4f5fa1c
6 changed files with 51 additions and 20 deletions
|
|
@ -36,8 +36,12 @@ export async function createFileActivity(file: File, type: string, data: any, ch
|
|||
return res;
|
||||
}
|
||||
|
||||
export async function createYouTubeVideoActivity(data: any, activity: any, chapter_id: any) {
|
||||
const result = await fetch(`${getAPIUrl()}activities/youtubevideo?coursechapter_id=${chapter_id}`, RequestBody("POST", data));
|
||||
export async function createExternalVideoActivity(data: any, activity: any, chapter_id: any) {
|
||||
// add coursechapter_id to data
|
||||
data.coursechapter_id = chapter_id;
|
||||
data.activity_id = activity.id;
|
||||
|
||||
const result = await fetch(`${getAPIUrl()}activities/external_video?coursechapter_id=${chapter_id}`, RequestBody("POST", data));
|
||||
const res = await result.json();
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue