All files / src/hooks useRecentEventPhotos.ts

100% Statements 3/3
100% Branches 2/2
100% Functions 2/2
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15              1x 6x   3x        
/**
 * Hook for recent event photos (homepage marquee).
 * Story 10.21: Event Photos Gallery — AC6
 */
import { useQuery } from '@tanstack/react-query';
import { eventApiClient } from '@/services/eventApiClient';
 
export const useRecentEventPhotos = (limit = 20, lastNEvents = 5) => {
  return useQuery({
    queryKey: ['recent-event-photos', limit, lastNEvents],
    queryFn: () => eventApiClient.getRecentEventPhotos(limit, lastNEvents),
    staleTime: 5 * 60 * 1000, // 5 min — homepage doesn't need real-time refresh
  });
};