feat: Enable TypeScript strict mode

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 00:58:42 +00:00
parent 061c06be29
commit d126be2908
15 changed files with 308 additions and 68 deletions

View File

@@ -93,15 +93,21 @@ export function ItemEditDialog({ item, items, open, onOpenChange, onComplete }:
};
const handlePhotoSubmit = async (caption: string, credit: string) => {
const itemData = typeof item.item_data === 'object' && item.item_data !== null && !Array.isArray(item.item_data)
? item.item_data as Record<string, unknown>
: {};
const photos = 'photos' in itemData && Array.isArray(itemData.photos)
? itemData.photos
: [];
const photoData = {
...item.item_data,
photos: Array.isArray(item.item_data.photos)
? item.item_data.photos.map((photo: unknown) => ({
...(typeof photo === 'object' && photo !== null ? photo : {}),
caption,
credit,
}))
: [],
...itemData,
photos: photos.map((photo: unknown) => ({
...(typeof photo === 'object' && photo !== null ? photo as Record<string, unknown> : {}),
caption,
credit,
})),
};
await handleSubmit(photoData);
};