Improve task visibility for director and manager roles

Update `Tasks.tsx` to enable data fetching for users with 'directeur' or 'manager' roles, provided a `selectedStoreId` is present, and for 'admin' roles without store selection restrictions.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/yiEpJFx
This commit is contained in:
michaelschal committed 2025-09-09 08:33:25 +00:00
1 parent d96ae9c47d
commit aae9d8a712
1 file changed
+1 -1
+1 -1
View File
@@ -387,7 +387,7 @@ export default function Tasks() {
throw error;
}
},
enabled: !!user,
enabled: !!user && (user.role === 'admin' || (user.role === 'directeur' || user.role === 'manager' ? !!selectedStoreId : true)),
});
// Fetch users for task assignment - seulement pour admin/manager/directeur