feat: reformat utility req functions to use next

This commit is contained in:
swve 2023-05-19 09:08:02 +00:00
parent 1f6020efc0
commit bb0f9166f9
14 changed files with 43 additions and 41 deletions

View file

@ -7,14 +7,14 @@ export async function uploadNewPDFFile(file: any, activity_id: string) {
formData.append("file_object", file);
formData.append("activity_id", activity_id);
return fetch(`${getAPIUrl()}blocks/pdf`, RequestBodyForm("POST", formData))
return fetch(`${getAPIUrl()}blocks/pdf`, RequestBodyForm("POST", formData, null))
.then((result) => result.json())
.catch((error) => console.log("error", error));
}
export async function getPDFFile(file_id: string) {
// todo : add course id to url
return fetch(`${getAPIUrl()}blocks/pdf?file_id=${file_id}`, RequestBody("GET", null))
return fetch(`${getAPIUrl()}blocks/pdf?file_id=${file_id}`, RequestBody("GET", null, null))
.then((result) => result.json())
.catch((error) => console.log("error", error));
}