Feat/certificate (#68)
* feat: implement certificate encoding and decoding functionality with AES encryption * feat: blank cert * Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -5,3 +5,4 @@ export * from './mentors';
|
||||
export * from './upload';
|
||||
export * from './teams';
|
||||
export * from './messages';
|
||||
export * from './winners';
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { hackathonApi, HackathonApiResponse } from '../../api/hackathon';
|
||||
|
||||
// Query keys
|
||||
export const winnerKeys = {
|
||||
all: ['winners'] as const,
|
||||
lists: () => [...winnerKeys.all, 'list'] as const,
|
||||
};
|
||||
|
||||
// API response types
|
||||
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<HackathonApiResponse<Winner[]>>({
|
||||
queryKey: winnerKeys.lists(),
|
||||
queryFn: async () => {
|
||||
const response = await hackathonApi.get('/winners');
|
||||
return response.data;
|
||||
},
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user