feat(#357): add refresh scores for home page
parent
02ca2e1400
commit
0e68373893
@ -0,0 +1,4 @@ |
|||||||
|
export const querieKeys = { |
||||||
|
matchScore: 'matchScore', |
||||||
|
liveMatchScores: 'liveMatchScores', |
||||||
|
} |
||||||
@ -0,0 +1,28 @@ |
|||||||
|
import { callApi } from 'helpers' |
||||||
|
|
||||||
|
import { API_ROOT } from 'config' |
||||||
|
|
||||||
|
type ScoreTeam = { |
||||||
|
id: number, |
||||||
|
score: number | null, |
||||||
|
} |
||||||
|
|
||||||
|
export type LiveScore = { |
||||||
|
match_id: number, |
||||||
|
sport_id: number, |
||||||
|
team1:ScoreTeam, |
||||||
|
team2: ScoreTeam, |
||||||
|
} |
||||||
|
|
||||||
|
export const getLiveScores = (): Promise<Array<LiveScore>> => { |
||||||
|
const url = `${API_ROOT}/v1/matches/live/scores` |
||||||
|
|
||||||
|
const config = { |
||||||
|
method: 'GET', |
||||||
|
} |
||||||
|
|
||||||
|
return callApi({ |
||||||
|
config, |
||||||
|
url, |
||||||
|
}) |
||||||
|
} |
||||||
Loading…
Reference in new issue