fix: resolve feedback validation issues from GitHub issue #16
- Fixed 400 Bad Request error when submitting feedback with name/email required - Updated backend validation to properly handle empty/undefined name/email fields - Modified frontend components to send undefined instead of empty strings when fields are not provided - Fixed thumbnail display issue in moderation view by using correct admin API endpoints - Updated FeedbackModerationPanel and EventFeedbackPage to display thumbnails correctly The issue was caused by the validation logic treating empty strings differently than undefined values. Frontend components now properly send undefined when name/email are not provided, and the backend validation correctly handles both cases. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -233,11 +233,11 @@ async function validateGuestRequirements(settings, guestData) {
|
||||
errors.push('Name is required');
|
||||
}
|
||||
|
||||
// Check for email - handle both undefined and empty strings
|
||||
// Check for email - handle both undefined and empty strings
|
||||
const email = guestData.guest_email;
|
||||
if (!email || (typeof email === 'string' && email.trim().length === 0)) {
|
||||
errors.push('Valid email is required');
|
||||
} else if (email && !validator.isEmail(email.trim())) {
|
||||
errors.push('Email is required');
|
||||
} else if (email && typeof email === 'string' && !validator.isEmail(email.trim())) {
|
||||
errors.push('Valid email is required');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user