diff --git a/attached_assets/image_1756821581378.png b/attached_assets/image_1756821581378.png new file mode 100644 index 0000000..2d016dc Binary files /dev/null and b/attached_assets/image_1756821581378.png differ diff --git a/client/src/pages/admin.tsx b/client/src/pages/admin.tsx index 8ffde44..4f0b2b8 100644 --- a/client/src/pages/admin.tsx +++ b/client/src/pages/admin.tsx @@ -277,7 +277,15 @@ function EditVideoDialog({ const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); - updateMutation.mutate(formData); + + // Convert string values to appropriate types for the API + const processedFormData = { + ...formData, + episodeNumber: formData.episodeNumber ? parseInt(formData.episodeNumber.toString()) : null, + tags: Array.isArray(formData.tags) ? formData.tags : [] + }; + + updateMutation.mutate(processedFormData); }; const generateAIDescription = async () => { @@ -314,8 +322,13 @@ function EditVideoDialog({ }; setFormData(newFormData); - // Automatically save the generated description - updateMutation.mutate(newFormData); + // Automatically save the generated description with proper type conversion + const processedData = { + ...newFormData, + episodeNumber: newFormData.episodeNumber ? parseInt(newFormData.episodeNumber.toString()) : null, + tags: Array.isArray(newFormData.tags) ? newFormData.tags : [] + }; + updateMutation.mutate(processedData); toast({ title: "Uspeh!", @@ -502,7 +515,7 @@ function EditVideoDialog({
- +