feat: refactor the entire learnhouse project

This commit is contained in:
swve 2023-10-13 20:03:27 +02:00
parent f556e41dda
commit 4c215e91d5
247 changed files with 7716 additions and 1013 deletions

View file

@ -1,20 +0,0 @@
import { getAPIUrl } from "@services/config/config";
import { RequestBody, RequestBodyForm } from "@services/utils/ts/requests";
export async function uploadNewImageFile(file: any, activity_id: string) {
// Send file thumbnail as form data
const formData = new FormData();
formData.append("file_object", file);
formData.append("activity_id", activity_id);
return fetch(`${getAPIUrl()}blocks/image`, RequestBodyForm("POST", formData, null))
.then((result) => result.json())
.catch((error) => console.log("error", error));
}
export async function getImageFile(file_id: string) {
// todo : add course id to url
return fetch(`${getAPIUrl()}blocks/image?file_id=${file_id}`, RequestBody("GET", null, null))
.then((result) => result.json())
.catch((error) => console.log("error", error));
}