Spaces:
Running
Running
Ig0tU Claude Sonnet 4.6 commited on
Commit ·
0fdb99c
1
Parent(s): d3ee56f
fix: honor form failing validation due to non-standard field names
Browse filesHonor form uses submitterEmail/submitterName/vetFirstName instead of
the generic email/name fields, causing all submissions to be rejected
with a 400 before reaching the spreadsheet.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
server.js
CHANGED
|
@@ -86,8 +86,10 @@ app.post('/api/submit', async (req, res) => {
|
|
| 86 |
try {
|
| 87 |
const { name, email, message, phone, subject, origin } = req.body;
|
| 88 |
|
| 89 |
-
|
| 90 |
-
|
|
|
|
|
|
|
| 91 |
return res.status(400).json({ error: 'Please provide at least a name, email, or phone number.' });
|
| 92 |
}
|
| 93 |
|
|
|
|
| 86 |
try {
|
| 87 |
const { name, email, message, phone, subject, origin } = req.body;
|
| 88 |
|
| 89 |
+
const hasIdentifier = name || email || phone ||
|
| 90 |
+
req.body.submitterEmail || req.body.submitterName || req.body.vetFirstName ||
|
| 91 |
+
req.body.contactName || req.body.groupName;
|
| 92 |
+
if (!hasIdentifier) {
|
| 93 |
return res.status(400).json({ error: 'Please provide at least a name, email, or phone number.' });
|
| 94 |
}
|
| 95 |
|