You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
spa_instat_tv/src/requests/saveMatchStats.tsx

30 lines
516 B

import { VIEWS_API } from 'config'
import { callApi } from 'helpers'
type Props = {
matchId: number,
matchSecond: number,
sportType: number,
}
export const VIEW_INTERVAL_MS = 5000
export const saveMatchStats = ({
matchId,
matchSecond,
sportType,
}: Props) => {
const url = `${VIEWS_API}/user/view`
const config = {
body: {
interval: VIEW_INTERVAL_MS / 1000,
match_id: matchId,
second: matchSecond,
sport_id: sportType,
},
}
return callApi({ config, url })
}