fix: video activites issue

This commit is contained in:
swve 2023-04-13 21:33:03 +02:00
parent 137a909347
commit 86645fa81a
5 changed files with 38 additions and 7 deletions

View file

@ -17,10 +17,12 @@ function DynamicCanvaModal({ submitActivity, chapterId }: any) {
const handleSubmit = async (e: any) => {
e.preventDefault();
console.log({ activityName, activityDescription, chapterId });
submitActivity({
name: activityName,
chapterId: chapterId,
type: "dynamic",
org_id : "test",
});
};
return (

View file

@ -16,12 +16,14 @@ export async function createFileActivity(file: File, type: string, data: any, ch
const formData = new FormData();
formData.append("coursechapter_id", chapter_id);
let endpoint = `${getAPIUrl()}activities/video`;
let org_id = "test";
let endpoint = `${getAPIUrl()}activities/video?org_id=${org_id}`;
if (type === "video") {
formData.append("name", data.name);
formData.append("video_file", file);
endpoint = `${getAPIUrl()}activities/video`;
endpoint = endpoint;
}
const result: any = await fetch(endpoint, RequestBodyForm("POST", formData));