@@ -182,6 +182,51 @@ function PdfRequestFiles() {
182
182
checkAlreadySign . length > 0
183
183
) {
184
184
setAlreadySign ( true ) ;
185
+ } else {
186
+ const obj = documentData ?. [ 0 ] ;
187
+ if (
188
+ obj &&
189
+ obj . Signers &&
190
+ obj . Signers . length > 0 &&
191
+ obj . Placeholders &&
192
+ obj . Placeholders . length > 0
193
+ ) {
194
+ const params = {
195
+ event : "viewed" ,
196
+ body : {
197
+ objectId : documentData ?. [ 0 ] . objectId ,
198
+ file : documentData ?. [ 0 ] ?. SignedUrl || documentData ?. [ 0 ] ?. URL ,
199
+ name : documentData ?. [ 0 ] . Name ,
200
+ note : documentData ?. [ 0 ] . Note || "" ,
201
+ description : documentData ?. [ 0 ] . Description || "" ,
202
+ signers : documentData ?. [ 0 ] . Signers ?. map ( ( x ) => ( {
203
+ name : x ?. Name ,
204
+ email : x ?. Email ,
205
+ phone : x ?. Phone
206
+ } ) ) ,
207
+ viewedBy : jsonSender . email ,
208
+ viewedAt : new Date ( ) ,
209
+ createdAt : documentData ?. [ 0 ] . createdAt
210
+ }
211
+ } ;
212
+
213
+ try {
214
+ await axios . post (
215
+ `${ localStorage . getItem ( "baseUrl" ) } functions/callwebhook` ,
216
+ params ,
217
+ {
218
+ headers : {
219
+ "Content-Type" : "application/json" ,
220
+ "X-Parse-Application-Id" :
221
+ localStorage . getItem ( "parseAppId" ) ,
222
+ sessiontoken : localStorage . getItem ( "accesstoken" )
223
+ }
224
+ }
225
+ ) ;
226
+ } catch ( err ) {
227
+ console . log ( "Err " , err ) ;
228
+ }
229
+ }
185
230
}
186
231
187
232
let signers = [ ] ;
@@ -616,10 +661,13 @@ function PdfRequestFiles() {
616
661
currnt : "YouDeclined" ,
617
662
isDeclined : true
618
663
} ;
664
+ setIsDecline ( currentDecline ) ;
665
+ setIsUiLoading ( false ) ;
619
666
const params = {
620
667
event : "declined" ,
621
668
body : {
622
669
objectId : pdfDetails ?. [ 0 ] . objectId ,
670
+ file : pdfDetails ?. [ 0 ] ?. SignedUrl || pdfDetails ?. [ 0 ] ?. URL ,
623
671
name : pdfDetails ?. [ 0 ] . Name ,
624
672
note : pdfDetails ?. [ 0 ] . Note || "" ,
625
673
description : pdfDetails ?. [ 0 ] . Description || "" ,
@@ -628,12 +676,12 @@ function PdfRequestFiles() {
628
676
email : x ?. Email ,
629
677
phone : x ?. Phone
630
678
} ) ) ,
631
- createdAt : pdfDetails ?. [ 0 ] . createdAt ,
632
- declinedAt : new Date ( )
679
+ declinedBy : jsonSender . email ,
680
+ declinedAt : new Date ( ) ,
681
+ createdAt : pdfDetails ?. [ 0 ] . createdAt
633
682
}
634
683
} ;
635
- setIsDecline ( currentDecline ) ;
636
- setIsUiLoading ( false ) ;
684
+
637
685
try {
638
686
await axios . post (
639
687
`${ localStorage . getItem ( "baseUrl" ) } functions/callwebhook` ,
0 commit comments