MCPcopy Create free account
hub / github.com/OpenSignLabs/OpenSign / fetchUrl

Function fetchUrl

apps/OpenSign/src/constant/Utils.js:2950–2963  ·  view source on GitHub ↗
(url, fileName)

Source from the content-addressed store, hash-verified

2948 }
2949};
2950export const fetchUrl = async (url, fileName) => {
2951 try {
2952 const response = await fetch(url);
2953 if (!response.ok) {
2954 alert(i18n.t("something-went-wrong-mssg"));
2955 throw new Error("Network response was not ok");
2956 }
2957 const blob = await response.blob();
2958 saveAs(blob, fileName);
2959 } catch (error) {
2960 alert(i18n.t("something-went-wrong-mssg"));
2961 console.error("Error downloading the file:", error);
2962 }
2963};
2964
2965export const getSignedUrl = async (pdfUrl, docId, templateId) => {
2966 //use only axios here due to public template sign

Callers 4

handleDownloadBtnFunction · 0.90
handleDownloadFunction · 0.90
handleDownloadFunction · 0.90
handleDownloadPdfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected