oran
Deploy Iddaai Frontend / build-and-deploy (push) Successful in 3m12s

This commit is contained in:
2026-06-07 23:50:29 +03:00
parent fbf279d2d0
commit 095992ad26
6 changed files with 172 additions and 80 deletions
+14
View File
@@ -48,9 +48,23 @@ const getActiveLeagues = (sport?: string) => {
});
};
export type OddsMovementDto = Record<
string,
Record<string, { open: number; close: number }>
>;
const getOddsMovement = (id: string) => {
return apiRequest<ApiResponse<OddsMovementDto>>({
url: `/matches/${id}/odds-movement`,
client: "core",
method: "get",
});
};
export const matchesService = {
listMatches,
getMatchDetails,
queryMatches,
getActiveLeagues,
getOddsMovement,
};
+10
View File
@@ -7,6 +7,8 @@ export const MatchesQueryKeys = {
list: (params?: MatchListParams) =>
[...MatchesQueryKeys.all, "list", params] as const,
detail: (id: string) => [...MatchesQueryKeys.all, "detail", id] as const,
oddsMovement: (id: string) =>
[...MatchesQueryKeys.all, "oddsMovement", id] as const,
activeLeagues: (sport?: string) =>
[...MatchesQueryKeys.all, "activeLeagues", sport] as const,
};
@@ -26,6 +28,14 @@ export const useMatchDetails = (id: string) => {
});
};
export const useOddsMovement = (id: string) => {
return useQuery({
queryKey: MatchesQueryKeys.oddsMovement(id),
queryFn: () => matchesService.getOddsMovement(id),
enabled: !!id,
});
};
export const useQueryMatches = () => {
return useMutation({
mutationFn: (queryDto: MatchQueryDto) =>