From 08e3258a32191ac39332cbb869ca70d86f8c4745 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Fri, 11 Jul 2025 18:49:16 +0000 Subject: [PATCH] Improve photo handling by ensuring images are correctly saved in the database Removes debug logs and ensures correct mapping of photo data from request body to database columns. Replit-Commit-Author: Agent Replit-Commit-Session-Id: dec54137-d5a2-4406-8ad4-5f2f9fb110bf Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/e6f3a8c1-bdaf-4251-a9d4-9326e97ede4b.jpg --- server/routes.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/server/routes.ts b/server/routes.ts index 7f9eec5..3030a26 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -243,12 +243,7 @@ export async function registerRoutes(app: Express): Promise { targetStoreId = user.storeId; } - // Debug logging - console.log('=== PHOTO MAPPING DEBUG ==='); - console.log('photoRecto present:', !!req.body.photoRecto); - console.log('photoVerso present:', !!req.body.photoVerso); - console.log('photoTicket present:', !!req.body.photoTicket); - console.log('photoTicket length:', req.body.photoTicket?.length); + // Photo mapping debug (can be removed in production) // Map frontend camelCase to database snake_case for photos const mappedBody = { @@ -258,15 +253,12 @@ export async function registerRoutes(app: Express): Promise { // Add photo fields with proper mapping, only if they exist and are not empty if (req.body.photoRecto) { mappedBody.photo_recto = req.body.photoRecto; - console.log('Added photo_recto to mappedBody'); } if (req.body.photoVerso) { mappedBody.photo_verso = req.body.photoVerso; - console.log('Added photo_verso to mappedBody'); } if (req.body.photoTicket) { mappedBody.photo_ticket = req.body.photoTicket; - console.log('Added photo_ticket to mappedBody'); } // Remove camelCase versions to avoid conflicts