MCPcopy Index your code
hub / github.com/OpenSIST/OpenSIST.github.io / getFileContent

Function getFileContent

src/Data/FileData.js:28–33  ·  view source on GitHub ↗
(fileId)

Source from the content-addressed store, hash-verified

26}
27
28export 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
35export async function addModifyFile(requestBody, type) {
36 const endpoint = {new: ADD_FILE, edit: MODIFY_FILE}[type];

Callers 2

onDownloadFunction · 0.90
getFileObjectFunction · 0.85

Calls 1

apiRequestFunction · 0.90

Tested by

no test coverage detected