(fileId)
| 26 | } |
| 27 | |
| 28 | export async function getFileContent(fileId) { |
| 29 | const response = await apiRequest(GET_FILE_CONTENT, {body: {PostID: fileId}}); |
| 30 | const blob = await response.blob(); |
| 31 | const pdfBlob = blob.type === "application/pdf" ? blob : new Blob([blob], {type: "application/pdf"}); |
| 32 | return URL.createObjectURL(pdfBlob); |
| 33 | } |
| 34 | |
| 35 | export async function addModifyFile(requestBody, type) { |
| 36 | const endpoint = {new: ADD_FILE, edit: MODIFY_FILE}[type]; |
no test coverage detected