mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 12:31:12 -05:00
Refactor code structure and remove redundant changes
This commit is contained in:
17
src-old/hooks/useEditHistory.ts
Normal file
17
src-old/hooks/useEditHistory.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { fetchEditHistory } from '@/lib/submissionItemsService';
|
||||
|
||||
/**
|
||||
* Phase 4: Hook to fetch edit history for a submission item
|
||||
*/
|
||||
export function useEditHistory(itemId: string | null) {
|
||||
return useQuery({
|
||||
queryKey: ['item-edit-history', itemId],
|
||||
queryFn: () => {
|
||||
if (!itemId) return [];
|
||||
return fetchEditHistory(itemId);
|
||||
},
|
||||
enabled: !!itemId,
|
||||
staleTime: 30000, // 30 seconds
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user