Implement cache management

This commit is contained in:
gpt-engineer-app[bot]
2025-10-31 00:46:42 +00:00
parent e2b064fa0b
commit 875d189881
16 changed files with 553 additions and 51 deletions

View File

@@ -1,5 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import { supabase } from '@/integrations/supabase/client';
import { queryKeys } from '@/lib/queryKeys';
export interface CoasterStat {
id: string;
@@ -15,7 +16,7 @@ export interface CoasterStat {
export function useCoasterStats(rideId: string | undefined) {
return useQuery({
queryKey: ['coaster-stats', rideId],
queryKey: queryKeys.stats.coaster(rideId || ''),
queryFn: async () => {
if (!rideId) return [];