website refactor

This commit is contained in:
2026-01-14 10:51:05 +01:00
parent 4522d41aef
commit 0d89ad027e
291 changed files with 6887 additions and 3685 deletions

View File

@@ -1,17 +1,23 @@
import { useQuery } from '@tanstack/react-query';
import { useInject } from '@/lib/di/hooks/useInject';
import { SPONSORSHIP_SERVICE_TOKEN } from '@/lib/di/tokens';
import { SPONSOR_SERVICE_TOKEN } from '@/lib/di/tokens';
import { enhanceQueryResult } from '@/lib/di/hooks/useReactQueryWithApiError';
export function useSponsorshipRequests(entityType: string, entityId: string) {
const sponsorshipService = useInject(SPONSORSHIP_SERVICE_TOKEN);
const sponsorshipService = useInject(SPONSOR_SERVICE_TOKEN);
const queryResult = useQuery({
queryKey: ['sponsorshipRequests', entityType, entityId],
queryFn: () => sponsorshipService.getPendingSponsorshipRequests({
entityType,
entityId,
}),
queryFn: async () => {
const result = await sponsorshipService.getPendingSponsorshipRequests({
entityType,
entityId,
});
if (result.isErr()) {
throw result.getError();
}
return result.unwrap();
},
enabled: !!entityType && !!entityId,
});