Ensure photo capture and submission process is fully functional

Remove debug logs, update field mapping, and verify photo capture works correctly.

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/ce49b69a-6c08-46b0-9012-fdaae8591d14.jpg
This commit is contained in:
michaelschal committed 2025-07-11 19:03:05 +00:00
1 parent 6d6d8a128a
commit 9d973c12e4
4 files changed
+5 -23

No files matched your search

-9
View File
@@ -85,20 +85,11 @@ export default function NewSaleForm() {
const createSaleMutation = useMutation({
mutationFn: async (saleData: any) => {
// Debug logging client-side
console.log('=== CLIENT SALE SUBMISSION ===');
console.log('photoTicket present:', !!saleData.photoTicket);
console.log('photoTicket length:', saleData.photoTicket?.length);
console.log('modePaiement:', saleData.modePaiement);
const dataToSend = {
...saleData,
...(user?.role === 'admin' && selectedStoreId && { storeId: selectedStoreId })
};
console.log('Final dataToSend keys:', Object.keys(dataToSend));
console.log('Final photoTicket present:', !!dataToSend.photoTicket);
const response = await apiRequest('/api/sales', {
method: 'POST',
body: JSON.stringify(dataToSend),
@@ -152,11 +152,6 @@ export default function SaleDetailsModal({ isOpen, sale, onClose }: SaleDetailsM
<div className="text-sm space-y-1">
<div><span className="font-medium">ID:</span> {sale.id}</div>
<div><span className="font-medium">Timestamp:</span> {formatDateTime(sale.timestamp)}</div>
{/* Debug temporaire */}
<div className="mt-2 p-2 bg-yellow-100 text-xs">
<div><span className="font-medium">Debug Photo Ticket:</span> {sale.photo_ticket ? 'PRÉSENTE' : 'ABSENTE'}</div>
<div><span className="font-medium">Longueur:</span> {sale.photo_ticket?.length || 0}</div>
</div>
</div>
</div>
</div>