Update video details for editing and saving

Modify the video editing modal to use a PATCH request with JSON body for updating video details via the API.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 11420304-80a9-4ef2-adff-cbdaa418ffa8
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/11420304-80a9-4ef2-adff-cbdaa418ffa8/YNIJhSt
This commit is contained in:
sebastjanartic 2025-08-07 08:45:15 +00:00
parent cce4d2456f
commit bf59448d89
2 changed files with 2 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View File

@ -30,10 +30,8 @@ export default function VideoEditModal({ video, isOpen, onClose }: VideoEditModa
const updateVideoMutation = useMutation({
mutationFn: async (updates: UpdateVideo) => {
return apiRequest(`/api/videos/${video.id}`, {
method: "PATCH",
body: updates
});
const response = await apiRequest("PATCH", `/api/videos/${video.id}`, updates);
return response.json();
},
onSuccess: () => {
toast({ title: "Video uspešno posodobljen!" });