15 lines
505 B
TypeScript
15 lines
505 B
TypeScript
import { useQuery } from '@tanstack/react-query';
|
|
import { useServices } from '@/lib/services/ServiceProvider';
|
|
import type { LeagueScoringPresetDTO } from '@/lib/types/generated/LeagueScoringPresetDTO';
|
|
|
|
export function useLeagueScoringPresets() {
|
|
const { leagueService } = useServices();
|
|
|
|
return useQuery({
|
|
queryKey: ['leagueScoringPresets'],
|
|
queryFn: async () => {
|
|
const result = await leagueService.getScoringPresets();
|
|
return result as LeagueScoringPresetDTO[];
|
|
},
|
|
});
|
|
} |