From 289c3c028a6a798a6fdfb1905798e99513ae236a Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Tue, 2 Sep 2025 14:19:26 +0000 Subject: [PATCH] Update video details in the administration panel Add logging to the /api/admin/videos/:id PATCH endpoint and the BunnyStorage updateVideo method in server/storage.ts to capture video update requests and parsed data. 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/n7jzC7R --- server/routes.ts | 2 ++ server/storage.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/server/routes.ts b/server/routes.ts index 393b613..170ad09 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -909,7 +909,9 @@ export async function registerRoutes(app: Express): Promise { app.patch('/api/admin/videos/:id', isAdmin, async (req, res) => { try { const videoId = req.params.id; + console.log(`PATCH request for video ${videoId} with body:`, JSON.stringify(req.body, null, 2)); const updateData = updateVideoSchema.parse(req.body); + console.log(`Parsed update data:`, JSON.stringify(updateData, null, 2)); const updatedVideo = await storage.updateVideo(videoId, updateData); if (!updatedVideo) { diff --git a/server/storage.ts b/server/storage.ts index 0efee18..f090ff0 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -852,6 +852,7 @@ class BunnyStorage implements IStorage { // Try to update in database first let dbUpdateSuccessful = false; try { + console.log(`Updating video ${id} with data:`, JSON.stringify(updates, null, 2)); await db.update(videos).set({...updates, updatedAt: new Date()}).where(eq(videos.id, id)); console.log(`Successfully updated video ${id} in database`); dbUpdateSuccessful = true;