website refactor
This commit is contained in:
@@ -8,7 +8,13 @@ export function useSponsorLeagueDetail(leagueId: string) {
|
||||
|
||||
const queryResult = useQuery({
|
||||
queryKey: ['sponsorLeagueDetail', leagueId],
|
||||
queryFn: () => sponsorService.getLeagueDetail(leagueId),
|
||||
queryFn: async () => {
|
||||
const result = await sponsorService.getLeagueDetail(leagueId);
|
||||
if (result.isErr()) {
|
||||
throw result.getError();
|
||||
}
|
||||
return result.unwrap();
|
||||
},
|
||||
enabled: !!leagueId,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user