From 7d778d9e9fb8797a50fbf01f5d740a04982af7f8 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Fri, 10 Oct 2025 15:58:50 +0000 Subject: [PATCH] Update dashboard to send store ID for all user roles Modify `Dashboard.tsx` to include `selectedStoreId` in the API request for `/api/dlc-products/stats` regardless of user role, shifting permission logic to the backend. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/gtlJIVB --- client/src/pages/Dashboard.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/pages/Dashboard.tsx b/client/src/pages/Dashboard.tsx index c59e78a..43b9994 100644 --- a/client/src/pages/Dashboard.tsx +++ b/client/src/pages/Dashboard.tsx @@ -231,7 +231,8 @@ export default function Dashboard() { queryKey: ["/api/dlc-products/stats", selectedStoreId], queryFn: () => { const params = new URLSearchParams(); - if (selectedStoreId && user?.role === 'admin') params.append("storeId", selectedStoreId.toString()); + // Envoyer selectedStoreId pour tous les utilisateurs (le backend gère les permissions) + if (selectedStoreId) params.append("storeId", selectedStoreId.toString()); return fetch(`/api/dlc-products/stats?${params.toString()}`, { credentials: 'include' }).then(res => res.json());