mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: format with prettier
This commit is contained in:
parent
03fb09c3d6
commit
a147ad6610
164 changed files with 11257 additions and 8154 deletions
|
|
@ -1,20 +1,26 @@
|
|||
import { getAPIUrl } from "@services/config/config";
|
||||
import { RequestBody, RequestBodyForm } from "@services/utils/ts/requests";
|
||||
import { getAPIUrl } from '@services/config/config'
|
||||
import { RequestBody, RequestBodyForm } from '@services/utils/ts/requests'
|
||||
|
||||
export async function uploadNewPDFFile(file: any, activity_uuid: string) {
|
||||
// Send file thumbnail as form data
|
||||
const formData = new FormData();
|
||||
formData.append("file_object", file);
|
||||
formData.append("activity_uuid", activity_uuid);
|
||||
const formData = new FormData()
|
||||
formData.append('file_object', file)
|
||||
formData.append('activity_uuid', activity_uuid)
|
||||
|
||||
return fetch(`${getAPIUrl()}blocks/pdf`, RequestBodyForm("POST", formData, null))
|
||||
return fetch(
|
||||
`${getAPIUrl()}blocks/pdf`,
|
||||
RequestBodyForm('POST', formData, null)
|
||||
)
|
||||
.then((result) => result.json())
|
||||
.catch((error) => console.log("error", error));
|
||||
.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, null))
|
||||
return fetch(
|
||||
`${getAPIUrl()}blocks/pdf?file_id=${file_id}`,
|
||||
RequestBody('GET', null, null)
|
||||
)
|
||||
.then((result) => result.json())
|
||||
.catch((error) => console.log("error", error));
|
||||
.catch((error) => console.log('error', error))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue