@@ -349,7 +349,7 @@ <h2 data-aos="fade" data-aos-duration="700" data-aos-delay="400">1. Character Cr
349
349
customAlert ( 'Biomarker data is missing. Please complete the biomarker form.' ) ;
350
350
return ;
351
351
}
352
- console . log ( biomarkerData ) ;
352
+
353
353
// Create the applicant data object
354
354
const applicantData = {
355
355
name : name ,
@@ -902,26 +902,29 @@ <h2 data-aos="fade" data-aos-duration="700" data-aos-delay="400">1. Character Cr
902
902
903
903
if ( response . ok ) {
904
904
// Handle success, perhaps redirect or show a success message
905
- customAlert ( 'Application submitted successfully!' ) ;
906
- localStorage . setItem ( 'contactEmail' , applicantData . accountEmail ) ;
907
- // Clear the image variables
908
- profilePic = null ;
909
- proofPics = [ ] ;
910
- // Redirect or reset the form
911
- window . location . href = '/onboarding/application-review.html#appReviewTitle' ;
905
+ customAlert ( 'Application submitted successfully!' ) . then ( ( ) => {
906
+ localStorage . setItem ( 'contactEmail' , applicantData . accountEmail ) ;
907
+ // Clear the image variables
908
+ profilePic = null ;
909
+ proofPics = [ ] ;
910
+ // Redirect or reset the form
911
+ window . location . href = '/onboarding/application-review.html#appReviewTitle' ;
912
+ } ) ;
912
913
} else {
913
914
// Handle error
914
- customAlert ( 'Failed to submit application. Please try again later.' ) ;
915
- applyButton . disabled = false ;
916
- applyButton . textContent = 'Apply' ;
915
+ customAlert ( 'Failed to submit application. Please try again later.' ) . then ( ( ) => {
916
+ applyButton . disabled = false ;
917
+ applyButton . textContent = 'Apply' ;
918
+ } ) ;
917
919
}
918
920
919
921
} )
920
922
. catch ( error => {
921
923
console . error ( 'Error submitting application:' , error ) ;
922
- customAlert ( 'An error occurred while submitting your application.' ) ;
923
- applyButton . disabled = false ;
924
- applyButton . textContent = 'Apply' ;
924
+ customAlert ( 'An error occurred while submitting your application.' ) . then ( ( ) => {
925
+ applyButton . disabled = false ;
926
+ applyButton . textContent = 'Apply' ;
927
+ } ) ;
925
928
} ) ;
926
929
}
927
930
}
0 commit comments