|
|
|
@ -18,7 +18,14 @@ export type MatchesTimeline = { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export const getTimelineMatches = (sportId?: number): Promise<MatchesTimeline> => { |
|
|
|
export const getTimelineMatches = (sportId?: number): Promise<MatchesTimeline> => { |
|
|
|
const url = new URL(`${API_ROOT}/v1/matches/timeline`) |
|
|
|
const getTimezoneOffset = () => { |
|
|
|
|
|
|
|
const offset = new Date().getTimezoneOffset() |
|
|
|
|
|
|
|
if (offset === 0) return offset |
|
|
|
|
|
|
|
return -(offset) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const timeZoneOffset = getTimezoneOffset() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const url = new URL(`${API_ROOT}/v1/broadcasts/timeline/${timeZoneOffset}`) |
|
|
|
|
|
|
|
|
|
|
|
if (sportId) { |
|
|
|
if (sportId) { |
|
|
|
url.searchParams.append('sport_id', `${sportId}`) |
|
|
|
url.searchParams.append('sport_id', `${sportId}`) |
|
|
|
|