fix(#3099): save match stats
parent
2d445cbc02
commit
66ddaf141e
@ -0,0 +1,30 @@ |
|||||||
|
import { SportTypes, VIEWS_API } from 'config' |
||||||
|
|
||||||
|
import { callApi } from 'helpers' |
||||||
|
|
||||||
|
type Props = { |
||||||
|
matchId: number, |
||||||
|
matchSecond: number, |
||||||
|
sportType: SportTypes, |
||||||
|
} |
||||||
|
|
||||||
|
export const intervalMs = 15000 |
||||||
|
|
||||||
|
export const saveMatchStats = ({ |
||||||
|
matchId, |
||||||
|
matchSecond, |
||||||
|
sportType, |
||||||
|
}: Props) => { |
||||||
|
const url = `${VIEWS_API}/user/view` |
||||||
|
|
||||||
|
const config = { |
||||||
|
body: { |
||||||
|
interval: intervalMs / 1000, |
||||||
|
match_id: matchId, |
||||||
|
second: matchSecond, |
||||||
|
sport_id: sportType, |
||||||
|
}, |
||||||
|
} |
||||||
|
|
||||||
|
return callApi({ config, url }) |
||||||
|
} |
||||||
Loading…
Reference in new issue