mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 10:27:49 +00:00
refactor: migrate to eslint flat config and format codebase with prettier
- Remove legacy .eslintrc.cjs and .eslintignore - Add eslint.config.js with flat config, security rules (no-eval, no-implied-eval, no-new-func, no-script-url) - Add .prettierrc and .prettierignore - Format entire codebase with prettier
This commit is contained in:
@@ -1,49 +1,50 @@
|
||||
import apiClient from './client'
|
||||
import apiClient from './client';
|
||||
|
||||
export interface ContestInfo {
|
||||
id: number
|
||||
slug: string
|
||||
name: string
|
||||
description: string | null
|
||||
prize_days: number
|
||||
is_available: boolean
|
||||
already_played: boolean
|
||||
id: number;
|
||||
slug: string;
|
||||
name: string;
|
||||
description: string | null;
|
||||
prize_days: number;
|
||||
is_available: boolean;
|
||||
already_played: boolean;
|
||||
}
|
||||
|
||||
export interface ContestGameData {
|
||||
round_id: number
|
||||
game_type: string
|
||||
game_data: Record<string, any>
|
||||
instructions: string
|
||||
round_id: number;
|
||||
game_type: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
game_data: Record<string, any>;
|
||||
instructions: string;
|
||||
}
|
||||
|
||||
export interface ContestResult {
|
||||
is_winner: boolean
|
||||
message: string
|
||||
prize_days?: number
|
||||
is_winner: boolean;
|
||||
message: string;
|
||||
prize_days?: number;
|
||||
}
|
||||
|
||||
export interface ContestsCountResponse {
|
||||
count: number
|
||||
count: number;
|
||||
}
|
||||
|
||||
export const contestsApi = {
|
||||
// Get count of available contests
|
||||
getCount: async (): Promise<ContestsCountResponse> => {
|
||||
const response = await apiClient.get<ContestsCountResponse>('/cabinet/contests/count')
|
||||
return response.data
|
||||
const response = await apiClient.get<ContestsCountResponse>('/cabinet/contests/count');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Get list of available contests
|
||||
getContests: async (): Promise<ContestInfo[]> => {
|
||||
const response = await apiClient.get<ContestInfo[]>('/cabinet/contests')
|
||||
return response.data
|
||||
const response = await apiClient.get<ContestInfo[]>('/cabinet/contests');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Get game data for a specific contest
|
||||
getContestGame: async (roundId: number): Promise<ContestGameData> => {
|
||||
const response = await apiClient.get<ContestGameData>(`/cabinet/contests/${roundId}`)
|
||||
return response.data
|
||||
const response = await apiClient.get<ContestGameData>(`/cabinet/contests/${roundId}`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Submit answer for a contest
|
||||
@@ -51,7 +52,7 @@ export const contestsApi = {
|
||||
const response = await apiClient.post<ContestResult>(`/cabinet/contests/${roundId}/answer`, {
|
||||
round_id: roundId,
|
||||
answer,
|
||||
})
|
||||
return response.data
|
||||
});
|
||||
return response.data;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user