chore: refactor block files

This commit is contained in:
swve 2023-02-19 23:37:47 +01:00
parent 642e55ce2e
commit 0b2e407bf3
9 changed files with 30 additions and 87 deletions

View file

@ -7,14 +7,14 @@ export async function uploadNewImageFile(file: any, lecture_id: string) {
formData.append("file_object", file);
formData.append("lecture_id", lecture_id);
return fetch(`${getAPIUrl()}files/picture`, RequestBodyForm("POST", formData))
return fetch(`${getAPIUrl()}blocks/image`, RequestBodyForm("POST", formData))
.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()}files/picture?file_id=${file_id}`, RequestBody("GET", null))
return fetch(`${getAPIUrl()}blocks/image?file_id=${file_id}`, RequestBody("GET", null))
.then((result) => result.json())
.catch((error) => console.log("error", error));
}