diff --git a/attached_assets/image_1755031479607.png b/attached_assets/image_1755031479607.png new file mode 100644 index 0000000..cf4a86f Binary files /dev/null and b/attached_assets/image_1755031479607.png differ diff --git a/attached_assets/image_1755031497130.png b/attached_assets/image_1755031497130.png new file mode 100644 index 0000000..cf4a86f Binary files /dev/null and b/attached_assets/image_1755031497130.png differ diff --git a/client/src/pages/Deliveries.tsx b/client/src/pages/Deliveries.tsx index c93b786..a6800a0 100644 --- a/client/src/pages/Deliveries.tsx +++ b/client/src/pages/Deliveries.tsx @@ -10,6 +10,7 @@ import { useStore } from "@/components/Layout"; import { useToast } from "@/hooks/use-toast"; import { apiRequest } from "@/lib/queryClient"; import { isUnauthorizedError } from "@/lib/authUtils"; +import { usePermissions } from "@shared/permissions"; import { Plus, Search, @@ -36,6 +37,7 @@ export default function Deliveries() { const { selectedStoreId } = useStore(); const { toast } = useToast(); const queryClient = useQueryClient(); + const permissions = usePermissions(user?.role); // Redirection pour les employés if (user?.role === 'employee') { @@ -219,7 +221,7 @@ export default function Deliveries() { }; const handleViewDelivery = (delivery: DeliveryWithRelations) => { - setSelectedDelivery({ ...delivery, type: 'delivery' }); + setSelectedDelivery(delivery); setShowDetailModal(true); }; @@ -316,7 +318,7 @@ export default function Deliveries() {
- ) : (console.log('🚚 Filtered deliveries length:', filteredDeliveries.length) || filteredDeliveries.length === 0) ? ( + ) : filteredDeliveries.length === 0 ? (

Aucune livraison trouvée

diff --git a/client/src/pages/Orders.tsx b/client/src/pages/Orders.tsx index f4f18d4..cac0326 100644 --- a/client/src/pages/Orders.tsx +++ b/client/src/pages/Orders.tsx @@ -10,6 +10,7 @@ import { useStore } from "@/components/Layout"; import { useToast } from "@/hooks/use-toast"; import { apiRequest } from "@/lib/queryClient"; import { isUnauthorizedError } from "@/lib/authUtils"; +import { usePermissions } from "@shared/permissions"; import { Plus, Search, @@ -34,6 +35,7 @@ export default function Orders() { const { selectedStoreId } = useStore(); const { toast } = useToast(); const queryClient = useQueryClient(); + const permissions = usePermissions(user?.role); // Redirection pour les employés if (user?.role === 'employee') { @@ -197,7 +199,7 @@ export default function Orders() { }; const handleViewOrder = (order: OrderWithRelations) => { - setSelectedOrder({ ...order, type: 'order' }); + setSelectedOrder(order); setShowDetailModal(true); }; @@ -285,7 +287,7 @@ export default function Orders() {
- ) : (console.log('📦 Filtered orders length:', filteredOrders.length) || filteredOrders.length === 0) ? ( + ) : filteredOrders.length === 0 ? (

Aucune commande trouvée