website refactor
This commit is contained in:
@@ -9,9 +9,12 @@ export function useLeagueScoringPresets() {
|
||||
|
||||
const queryResult = useQuery({
|
||||
queryKey: ['leagueScoringPresets'],
|
||||
queryFn: async () => {
|
||||
queryFn: async (): Promise<LeagueScoringPresetDTO[]> => {
|
||||
const result = await leagueService.getScoringPresets();
|
||||
return result as LeagueScoringPresetDTO[];
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.getError().message);
|
||||
}
|
||||
return result.unwrap() as unknown as LeagueScoringPresetDTO[];
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user