mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
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
This commit is contained in:
1 parent
d98888de6c
commit
7d778d9e9f
1 file changed
+2
-1
@@ -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());
|
||||
|
||||
Reference in new issue
Block a user