feat: Implement full Phase 3 API optimizations

This commit is contained in:
gpt-engineer-app[bot]
2025-10-30 23:02:26 +00:00
parent 46ca1c29bc
commit 0091584677
18 changed files with 654 additions and 243 deletions

View File

@@ -31,7 +31,50 @@ export const queryKeys = {
closingSoonRides: () => ['homepage', 'closing-soon-rides'] as const,
recentlyClosedParks: () => ['homepage', 'recently-closed-parks'] as const,
recentlyClosedRides: () => ['homepage', 'recently-closed-rides'] as const,
featuredParks: {
topRated: () => ['homepage', 'featured-parks', 'top-rated'] as const,
mostRides: () => ['homepage', 'featured-parks', 'most-rides'] as const,
},
},
// Add more query keys as needed
// Parks queries
parks: {
all: () => ['parks', 'all'] as const,
detail: (slug: string) => ['parks', 'detail', slug] as const,
rides: (parkId: string) => ['parks', 'rides', parkId] as const,
},
// Rides queries
rides: {
all: () => ['rides', 'all'] as const,
detail: (parkSlug: string, rideSlug: string) => ['rides', 'detail', parkSlug, rideSlug] as const,
similar: (parkId: string, category: string, currentId: string) =>
['rides', 'similar', parkId, category, currentId] as const,
},
// Reviews queries
reviews: {
entity: (entityType: 'park' | 'ride', entityId: string) =>
['reviews', entityType, entityId] as const,
user: (userId: string, filter: string, sortBy: string) =>
['reviews', 'user', userId, filter, sortBy] as const,
},
// Photos queries
photos: {
entity: (entityType: string, entityId: string) =>
['photos', entityType, entityId] as const,
count: (entityType: string, entityId: string) =>
['photos', 'count', entityType, entityId] as const,
},
// Search queries
search: {
global: (query: string) => ['search', 'global', query] as const,
},
// Lists queries
lists: {
items: (listId: string) => ['list-items', listId] as const,
},
} as const;