Refresh DLC product data when the selected store changes

Invalidates the "/api/dlc-products" query when `selectedStoreId` changes to ensure fresh DLC product data is fetched.

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/Q8UjAXl
This commit is contained in:
michaelschal committed 2025-09-30 16:28:11 +00:00
1 parent 704e6fc9c6
commit d41dc27023
1 file changed
+5
+5
View File
@@ -41,6 +41,11 @@ export function DlcAlertModal({ isOpen, onClose, dlcStats, selectedStoreId }: Dl
const queryClient = useQueryClient();
const [snoozeUntil, setSnoozeUntil] = useState<Date | null>(null);
// Invalider les queries DLC quand le magasin change
useEffect(() => {
queryClient.invalidateQueries({ queryKey: ["/api/dlc-products"] });
}, [selectedStoreId, queryClient]);
// Fetch detailed DLC products for the modal
const { data: expiredProducts = [] } = useQuery<DlcProduct[]>({
queryKey: ["/api/dlc-products", "expires", selectedStoreId],