mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-19 05:07:57 +02:00
Make sure directors and managers see correct store data
Fixes an issue where directors and managers might see data from multiple stores incorrectly. Ensures roles with limited store access only view their designated information and prompts explicit store selection when no store is chosen. Updates the UI to correctly display store selectors based on user roles. Also adds cache invalidation for user data upon authentication updates and refines API filtering for orders and deliveries to respect user roles and store selections. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 15f19c36-9aac-46a4-a181-3dc5f496fabd Replit-Commit-Checkpoint-Type: full_checkpoint
This commit is contained in:
1 parent
c1b5d66f1e
commit
46de48f459
4 files changed
+135
-26
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
// Hook d'authentification unifié qui s'adapte automatiquement
|
||||
// En production utilise fetch direct, en développement utilise React Query
|
||||
@@ -104,6 +104,7 @@ export function useAuthUnified() {
|
||||
} else {
|
||||
// En développement, forcer un refetch avec invalidation du cache
|
||||
console.log('🔄 Development mode - invalidating cache and refetching');
|
||||
const queryClient = useQueryClient();
|
||||
queryClient.invalidateQueries({ queryKey: ['/api/user'] });
|
||||
|
||||
// Attendre un court délai pour la propagation
|
||||
|
||||
Reference in new issue
Block a user