- Fix API service paths to use /v1/iam/, /v1/dimentorin/, /v1/gacha/, /v1/hackathon/ prefixes - Add roles, permissions, events, testimonials, sessions API services and hooks - Rewrite gacha service with full CRUD + roll/claim endpoints - Replace all mock data in backoffice pages with real API calls (accounts, roles, permissions, gacha-roll, dashboard, sessions, users-dimentorin, feedback-review, settings) - Wire dimentorin mentoring list to useMentorList with search + pagination - Wire dimentorin mentor detail page to useMentorById, pass real data to all sections - Wire appointment modal to useBookSession with controlled schedule inputs - Wire gacha app Spin Now to useExecuteGachaRoll, show credits and real items Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
797 B
TypeScript
27 lines
797 B
TypeScript
import { useQuery } from '@tanstack/react-query';
|
|
import { api } from '../../api/index';
|
|
|
|
export const winnerKeys = {
|
|
all: ['winners'] as const,
|
|
lists: () => [...winnerKeys.all, 'list'] as const,
|
|
};
|
|
|
|
interface Team {
|
|
id: string; name: string; description: string; city: string; visibility: string;
|
|
logo: string; banner: string; leader_id: string; created_at: string; updated_at: string;
|
|
}
|
|
interface Winner {
|
|
id: string; team_id: string; team: Team; rank: number; prize: string;
|
|
announced_at: string; created_at: string; updated_at: string;
|
|
}
|
|
|
|
export const useWinners = () => {
|
|
return useQuery({
|
|
queryKey: winnerKeys.lists(),
|
|
queryFn: async () => {
|
|
const response = await api.get<{ data: Winner[] }>('/v1/hackathon/winners');
|
|
return response.data;
|
|
},
|
|
});
|
|
};
|