feat: implement youtube backend and partial front

This commit is contained in:
swve 2023-05-14 15:02:09 +00:00
parent cdd1ca46d3
commit 77d4f5fa1c
6 changed files with 51 additions and 20 deletions

View file

@ -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;
}