File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -21,18 +21,30 @@ export default function Movement() {
2121 e . preventDefault ( ) ;
2222
2323 try {
24- const response = await fetch ( 'http://automation.riskfirst.org:8080/api/movement/submit' , {
24+ console . log ( 'Submitting form data:' , formData ) ;
25+ console . log ( 'Current origin:' , window . location . origin ) ;
26+ console . log ( 'Current protocol:' , window . location . protocol ) ;
27+ console . log ( 'Current hostname:' , window . location . hostname ) ;
28+
29+ // Use HTTPS through Cloudflare
30+ const response = await fetch ( 'https://automation.riskfirst.org/api/movement/submit' , {
2531 method : 'POST' ,
2632 headers : {
2733 'Content-Type' : 'application/json' ,
2834 } ,
2935 body : JSON . stringify ( formData ) ,
3036 } ) ;
3137
38+ console . log ( 'Response status:' , response . status ) ;
39+ console . log ( 'Response headers:' , response . headers ) ;
40+
3241 if ( response . ok ) {
42+ const result = await response . text ( ) ;
43+ console . log ( 'Response body:' , result ) ;
3344 setIsSubmitted ( true ) ;
3445 } else {
35- console . error ( 'Form submission failed' ) ;
46+ const errorText = await response . text ( ) ;
47+ console . error ( 'Form submission failed:' , response . status , errorText ) ;
3648 alert ( 'There was an error submitting the form. Please try again.' ) ;
3749 }
3850 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments