@@ -9,7 +9,7 @@ import { useNavigate } from "react-router-dom";
9
9
import { themeColor } from "../../constant/const" ;
10
10
import axios from "axios" ;
11
11
import ModalUi from "../../primitives/ModalUi" ;
12
- import Parse from "parse " ;
12
+ import { appInfo } from "../../constant/appinfo " ;
13
13
14
14
function Header ( {
15
15
isPdfRequestFiles,
@@ -64,7 +64,19 @@ function Header({
64
64
event . preventDefault ( ) ;
65
65
66
66
try {
67
- const url = await Parse . Cloud . run ( "getsignedurl" , { url : pdfUrl } ) ;
67
+ // const url = await Parse.Cloud.run("getsignedurl", { url: pdfUrl });
68
+ const axiosRes = await axios . post (
69
+ `${ appInfo . baseUrl } /functions/getsignedurl` ,
70
+ { url : pdfUrl } ,
71
+ {
72
+ headers : {
73
+ "content-type" : "Application/json" ,
74
+ "X-Parse-Application-Id" : appInfo . appId ,
75
+ "X-Parse-Session-Token" : localStorage . getItem ( "accesstoken" )
76
+ }
77
+ }
78
+ ) ;
79
+ const url = axiosRes . data . result ;
68
80
const pdf = await getBase64FromUrl ( url ) ;
69
81
const isAndroidDevice = navigator . userAgent . match ( / A n d r o i d / i) ;
70
82
const isAppleDevice =
@@ -94,7 +106,19 @@ function Header({
94
106
const handleDownloadPdf = async ( ) => {
95
107
const pdfName = pdfDetails [ 0 ] && pdfDetails [ 0 ] . Name ;
96
108
try {
97
- const url = await Parse . Cloud . run ( "getsignedurl" , { url : pdfUrl } ) ;
109
+ // const url = await Parse.Cloud.run("getsignedurl", { url: pdfUrl });
110
+ const axiosRes = await axios . post (
111
+ `${ appInfo . baseUrl } /functions/getsignedurl` ,
112
+ { url : pdfUrl } ,
113
+ {
114
+ headers : {
115
+ "content-type" : "Application/json" ,
116
+ "X-Parse-Application-Id" : appInfo . appId ,
117
+ "X-Parse-Session-Token" : localStorage . getItem ( "accesstoken" )
118
+ }
119
+ }
120
+ ) ;
121
+ const url = axiosRes . data . result ;
98
122
saveAs ( url , `${ sanitizeFileName ( pdfName ) } _signed_by_OpenSign™.pdf` ) ;
99
123
} catch ( err ) {
100
124
console . log ( "err in getsignedurl" , err ) ;
@@ -577,8 +601,13 @@ function Header({
577
601
handleClose = { ( ) => setIsCertificate ( false ) }
578
602
>
579
603
< div className = "p-3 md:p-5 text-[13px] md:text-base text-center" >
580
- < p > Your completion certificate is being generated. Please wait momentarily.</ p >
581
- < p > If the download doesn't start shortly, click the button again.</ p >
604
+ < p >
605
+ Your completion certificate is being generated. Please wait
606
+ momentarily.
607
+ </ p >
608
+ < p >
609
+ If the download doesn't start shortly, click the button again.
610
+ </ p >
582
611
</ div >
583
612
</ ModalUi >
584
613
</ div >
0 commit comments