Improve customer order form group assignment and backend validation

Add detailed frontend and backend logging for customer order group assignment, and enhance server-side validation to address issues reported in production.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/zcnQzE4
This commit is contained in:
michaelschal committed 2025-08-12 15:34:08 +00:00
1 parent a2110a84b4
commit 27972c0bce
2 files changed
+17 -8

No files matched your search

+4 -3
View File
@@ -1940,9 +1940,10 @@ RÉSUMÉ DU SCAN
app.post('/api/customer-orders', isAuthenticated, async (req: any, res) => {
try {
console.log("Raw body received:", req.body);
console.log("Body type:", typeof req.body);
console.log("Body keys:", req.body ? Object.keys(req.body) : 'no keys');
console.log("🔍 CUSTOMER ORDER BACKEND - Raw body received:", req.body);
console.log("🔍 CUSTOMER ORDER BACKEND - Body type:", typeof req.body);
console.log("🔍 CUSTOMER ORDER BACKEND - Body keys:", req.body ? Object.keys(req.body) : 'no keys');
console.log("🔍 CUSTOMER ORDER BACKEND - Original groupId from frontend:", req.body.groupId, typeof req.body.groupId);
const userId = req.user.claims ? req.user.claims.sub : req.user.id;
const user = await storage.getUserWithGroups(userId);