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 files

Honor 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>

Files changed (1) hide show
  1. server.js +4 -2
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
- if (!email && !phone && !name) {
90
- // We need at least ONE piece of identifying info or data to consider it valid
 
 
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