Skip to content

Commit 0becc37

Browse files
authored
Merge pull request #160 from risk-first/movement
using https for submit
2 parents 4acd184 + 9daacf9 commit 0becc37

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/components/Movement/index.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)