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;