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.
45 lines
834 B
45 lines
834 B
import { VIEWS_API } from 'config'
|
|
|
|
import { callApi } from 'helpers'
|
|
|
|
type Props = {
|
|
matchDate?: string,
|
|
matchId: number,
|
|
matchSecond: number,
|
|
seasonId?: number,
|
|
sportType: number,
|
|
teamFirst?: number,
|
|
teamSecond?: number,
|
|
tournamentId?: number,
|
|
}
|
|
|
|
export const VIEW_INTERVAL_MS = 5000
|
|
|
|
export const saveMatchStats = ({
|
|
matchDate,
|
|
matchId,
|
|
matchSecond,
|
|
seasonId,
|
|
sportType,
|
|
teamFirst,
|
|
teamSecond,
|
|
tournamentId,
|
|
}: Props) => {
|
|
const url = `${VIEWS_API}/v2/user/view`
|
|
|
|
const config = {
|
|
body: {
|
|
duration: VIEW_INTERVAL_MS / 1000,
|
|
match_date: matchDate,
|
|
match_id: matchId,
|
|
season: seasonId,
|
|
second: matchSecond,
|
|
sport_id: sportType,
|
|
team1: teamFirst,
|
|
team2: teamSecond,
|
|
tournament: tournamentId,
|
|
},
|
|
}
|
|
|
|
return callApi({ config, url })
|
|
}
|
|
|