mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 14:11:18 -05:00
feat: Implement Phase 4 cleanup and polish
This commit is contained in:
@@ -186,5 +186,69 @@ export function useQueryInvalidation() {
|
||||
queryKey: ['homepage', 'featured-parks']
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Invalidate company detail cache
|
||||
* Call this after updating a company
|
||||
*/
|
||||
invalidateCompanyDetail: (slug: string, type: string) => {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.companies.detail(slug, type) });
|
||||
},
|
||||
|
||||
/**
|
||||
* Invalidate company statistics cache
|
||||
* Call this after changes affecting company stats
|
||||
*/
|
||||
invalidateCompanyStatistics: (id: string, type: string) => {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.companies.statistics(id, type) });
|
||||
},
|
||||
|
||||
/**
|
||||
* Invalidate company parks cache
|
||||
* Call this after park changes
|
||||
*/
|
||||
invalidateCompanyParks: (id: string, type: 'operator' | 'property_owner') => {
|
||||
queryClient.invalidateQueries({ queryKey: ['companies', 'parks', id, type] });
|
||||
},
|
||||
|
||||
/**
|
||||
* Invalidate profile activity cache
|
||||
* Call this after user activity changes
|
||||
*/
|
||||
invalidateProfileActivity: (userId: string) => {
|
||||
queryClient.invalidateQueries({ queryKey: ['profile', 'activity', userId] });
|
||||
},
|
||||
|
||||
/**
|
||||
* Invalidate profile stats cache
|
||||
* Call this after user stats changes
|
||||
*/
|
||||
invalidateProfileStats: (userId: string) => {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.profile.stats(userId) });
|
||||
},
|
||||
|
||||
/**
|
||||
* Invalidate ride model detail cache
|
||||
* Call this after updating a ride model
|
||||
*/
|
||||
invalidateRideModelDetail: (manufacturerSlug: string, modelSlug: string) => {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.rideModels.detail(manufacturerSlug, modelSlug) });
|
||||
},
|
||||
|
||||
/**
|
||||
* Invalidate ride model statistics cache
|
||||
* Call this after changes affecting model stats
|
||||
*/
|
||||
invalidateRideModelStatistics: (modelId: string) => {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.rideModels.statistics(modelId) });
|
||||
},
|
||||
|
||||
/**
|
||||
* Invalidate model rides cache
|
||||
* Call this after ride changes
|
||||
*/
|
||||
invalidateModelRides: (modelId: string) => {
|
||||
queryClient.invalidateQueries({ queryKey: ['ride-models', 'rides', modelId] });
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user