Improve video editing form with data type conversion and Slovenian localization
Update the video editing form to correctly process episode numbers and tags before submission, ensuring proper data types. Localize UI elements such as "Visibility Status" and its options to Slovenian. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1/ezyc5gl
This commit is contained in:
parent
ae27c6f87e
commit
e2ec1209fe
BIN
attached_assets/image_1756821581378.png
Normal file
BIN
attached_assets/image_1756821581378.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
@ -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({
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label className="text-white/90">Visibility Status</Label>
|
||||
<Label className="text-white/90">Status vidnosti</Label>
|
||||
<Select
|
||||
value={formData.isPublic ? "public" : "private"}
|
||||
onValueChange={(value) => setFormData({ ...formData, isPublic: value === "public" })}
|
||||
@ -511,8 +524,8 @@ function EditVideoDialog({
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent className="bg-[#2D1B69] border-white/20">
|
||||
<SelectItem value="public">Published (Public)</SelectItem>
|
||||
<SelectItem value="private">Draft (Private)</SelectItem>
|
||||
<SelectItem value="public">Objavljeno (Javno)</SelectItem>
|
||||
<SelectItem value="private">Osnutek (Zasebno)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user