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