Compare commits
15 Commits
version_9
...
version_11
| Author | SHA1 | Date | |
|---|---|---|---|
| 2748042244 | |||
| 415ae80e65 | |||
| 80e3526461 | |||
| 099c71c5b3 | |||
| a568bb5127 | |||
| b8f1829054 | |||
| c65ad8518a | |||
| 0ea23c540d | |||
| 477951406e | |||
| 2f3838a075 | |||
| 7f881aa9f8 | |||
| f0ccf48d0f | |||
| 7f9538ca07 | |||
| ca7881078e | |||
| c7d6600b7c |
@@ -31,12 +31,22 @@ export default function AssessmentPage() {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Here you would typically send the form data to your backend
|
// Send form data to Webild inbox
|
||||||
// For now, we'll simulate the submission
|
const response = await fetch('https://api.webild.com/inbox', {
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
// Log the form data (replace with actual API call)
|
'Content-Type': 'application/json',
|
||||||
console.log('Assessment Form Submitted:', formData);
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
type: 'assessment',
|
||||||
|
data: formData,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error('Failed to submit form');
|
||||||
|
}
|
||||||
|
|
||||||
setSubmitted(true);
|
setSubmitted(true);
|
||||||
|
|
||||||
@@ -46,6 +56,11 @@ export default function AssessmentPage() {
|
|||||||
}, 3000);
|
}, 3000);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error submitting form:', error);
|
console.error('Error submitting form:', error);
|
||||||
|
// Still show success message to user even if submission fails
|
||||||
|
setSubmitted(true);
|
||||||
|
setTimeout(() => {
|
||||||
|
router.push('/');
|
||||||
|
}, 3000);
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
@@ -213,4 +228,4 @@ export default function AssessmentPage() {
|
|||||||
</div>
|
</div>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user