Fix validation and approval issues

This commit is contained in:
gpt-engineer-app[bot]
2025-10-17 23:11:51 +00:00
parent c74a41c2e3
commit ba67d5414f
3 changed files with 78 additions and 209 deletions

View File

@@ -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()) {