mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 17:11:13 -05:00
Fix validation and approval issues
This commit is contained in:
@@ -156,6 +156,39 @@ export function validateEntityDataStrict(
|
||||
}
|
||||
break;
|
||||
|
||||
case 'photo_edit':
|
||||
if (!data.photo_id) {
|
||||
result.blockingErrors.push('Photo ID is required');
|
||||
}
|
||||
if (!data.entity_type) {
|
||||
result.blockingErrors.push('Entity type is required');
|
||||
}
|
||||
if (!data.entity_id) {
|
||||
result.blockingErrors.push('Entity ID is required');
|
||||
}
|
||||
if (data.caption && data.caption.length > 500) {
|
||||
result.blockingErrors.push('Caption must be less than 500 characters');
|
||||
}
|
||||
if (data.title && data.title.length > 200) {
|
||||
result.blockingErrors.push('Title must be less than 200 characters');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'photo_delete':
|
||||
if (!data.photo_id) {
|
||||
result.blockingErrors.push('Photo ID is required');
|
||||
}
|
||||
if (!data.cloudflare_image_id && !data.photo_id) {
|
||||
result.blockingErrors.push('Photo identifier is required');
|
||||
}
|
||||
if (!data.entity_type) {
|
||||
result.blockingErrors.push('Entity type is required');
|
||||
}
|
||||
if (!data.entity_id) {
|
||||
result.blockingErrors.push('Entity ID is required');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'milestone':
|
||||
case 'timeline_event':
|
||||
if (!data.title?.trim()) {
|
||||
|
||||
Reference in New Issue
Block a user