Description
When the contact form submission fails (for any reason — duplicate email, missing fields, server error), the user sees a generic `alert("Form submit encountered an error, check console")`. This provides no actionable information.
Root Cause
Frontend (`/pages/patient/contactForm.vue`, lines 796-800):
```javascript
catch (e) {
console.log(e.statusMessage + ":");
console.log(e.data);
alert("Form submit encountered an error, check console");
}
// TODO make better than bandaid
```
Backend (`/server/api/contactForm/form.post.ts`, lines 75-77):
Uses `handlePrismaError(e)` which returns structured errors, but the frontend ignores the error details.
Fix
- Parse `e.data` and `e.statusMessage` from the server response
- Display specific error messages inline next to the relevant fields
- Common errors to handle:
- Duplicate email → "An account with this email already exists"
- Missing required field → highlight the field
- Server error → "Something went wrong, please try again"
- Remove the `alert()` and `console.log` approach
Related
Acceptance Criteria
Description
When the contact form submission fails (for any reason — duplicate email, missing fields, server error), the user sees a generic `alert("Form submit encountered an error, check console")`. This provides no actionable information.
Root Cause
Frontend (`/pages/patient/contactForm.vue`, lines 796-800):
```javascript
catch (e) {
console.log(e.statusMessage + ":");
console.log(e.data);
alert("Form submit encountered an error, check console");
}
// TODO make better than bandaid
```
Backend (`/server/api/contactForm/form.post.ts`, lines 75-77):
Uses `handlePrismaError(e)` which returns structured errors, but the frontend ignores the error details.
Fix
Related
Acceptance Criteria