diff --git a/client/src/pages/SavTickets.tsx b/client/src/pages/SavTickets.tsx index 540eb53..a52e53a 100644 --- a/client/src/pages/SavTickets.tsx +++ b/client/src/pages/SavTickets.tsx @@ -255,13 +255,15 @@ export default function SavTickets() { const ticketData: InsertSavTicket = { supplierId: parseInt(formData.supplierId), - groupId: selectedGroupId || undefined, + groupId: selectedGroupId || 1, // Default group if none available productGencode: formData.productGencode, productReference: formData.productReference || undefined, productDesignation: formData.productDesignation, problemType: formData.problemType as "defectueux" | "pieces_manquantes" | "non_conforme" | "autre", problemDescription: formData.problemDescription, priority: formData.priority as "faible" | "normale" | "haute" | "critique", + status: "nouveau" as const, + createdBy: 1, // Will be set by the backend from session clientName: formData.clientName || undefined, clientPhone: formData.clientPhone || undefined, }; @@ -843,16 +845,16 @@ export default function SavTickets() {

Problème

-
- Type: -

{selectedTicket.problemType}

-
-
- Priorité: - - {priorityConfig[selectedTicket.priority as keyof typeof priorityConfig]?.label} - -
+
+ Type: +

{selectedTicket.problemType}

+
+
+ Priorité: + + {priorityConfig[selectedTicket.priority as keyof typeof priorityConfig]?.label} + +
Description:

{selectedTicket.problemDescription}

@@ -881,23 +883,24 @@ export default function SavTickets() {

Informations ticket

-
- Statut: - - {statusConfig[selectedTicket.status as keyof typeof statusConfig]?.label} - -
-
- Fournisseur: -

{selectedTicket.supplier?.name}

-
-
- Magasin: -

{selectedTicket.group?.name}

-
-
- Créé le: -

{safeFormat(selectedTicket.createdAt, 'dd/MM/yyyy HH:mm')}

+
+ Statut: + + {statusConfig[selectedTicket.status as keyof typeof statusConfig]?.label} + +
+
+ Fournisseur: +

{selectedTicket.supplier?.name}

+
+
+ Magasin: +

{selectedTicket.group?.name}

+
+
+ Créé le: +

{safeFormat(selectedTicket.createdAt, 'dd/MM/yyyy HH:mm')}

+
@@ -959,74 +962,9 @@ export default function SavTickets() {

Historique et commentaires

{/* Affichage de l'historique existant */} - {ticketDetails?.history && ticketDetails.history.length > 0 ? ( + {(ticketDetails as any)?.history && (ticketDetails as any).history.length > 0 ? (
- {ticketDetails.history.map((entry: any, index: number) => ( -
-
- - {entry.action === 'comment' ? 'Commentaire' : entry.action} - - - {safeFormat(entry.createdAt, 'dd/MM/yyyy HH:mm')} - -
-

{entry.description}

- {entry.creator && ( -

Par: {entry.creator.username}

- )} -
- ))} -
- ) : ( -
- Aucun commentaire pour le moment -
- )} - - {/* Champ d'ajout de commentaire */} - {canModify && ( -
- -