feat: allow admins to add match participants

This commit is contained in:
dahyeon committed 2026-06-16 06:39:50 -07:00
1 parent 8aff1be225
commit 24983aeb09
11 files changed
+1019 -19

No files matched your search

+20
View File
@@ -13,6 +13,7 @@ import type {
ApiAuctionHistoryEntry,
ApiChampionStatsResponse,
ApiCommunity,
ApiCommunityUserSearchCandidate,
ApiEnqueueRefreshResult,
ApiInternalMatchDetailResponse,
ApiInternalMatchListResponse,
@@ -162,6 +163,25 @@ export function useMatch(matchId: string | undefined, communityId = DEFAULT_COMM
});
}
export function useCommunityUserSearch(
query: string,
communityId = DEFAULT_COMMUNITY_ID,
enabled = true,
) {
return useQuery({
queryKey: ['community-user-search', communityId, query],
queryFn: () => {
const searchParams = new URLSearchParams();
searchParams.set('query', query);
searchParams.set('limit', '10');
return apiFetch<ApiCommunityUserSearchCandidate[]>(
`/communities/${communityId}/users/search?${searchParams.toString()}`,
);
},
enabled: Boolean(communityId && enabled && query.trim().length >= 2),
});
}
export function useAuction(
matchId: string | undefined,
communityId = DEFAULT_COMMUNITY_ID,