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.
43 lines
701 B
43 lines
701 B
import {
|
|
DATA_URL,
|
|
PROCEDURES,
|
|
SportTypes,
|
|
} from 'config'
|
|
import { callApi } from 'helpers'
|
|
|
|
const proc = PROCEDURES.get_user_match_second
|
|
|
|
type Response = {
|
|
_p_half: number | null,
|
|
_p_second: number | null,
|
|
}
|
|
|
|
export type LastPlayPosition = {
|
|
half: number,
|
|
second: number,
|
|
}
|
|
|
|
export const getMatchLastWatchSeconds = async (
|
|
sportType: SportTypes,
|
|
matchId: number,
|
|
) => {
|
|
const config = {
|
|
body: {
|
|
params: {
|
|
_p_match_id: matchId,
|
|
_p_sport: sportType,
|
|
},
|
|
proc,
|
|
},
|
|
}
|
|
|
|
const response: Response = await callApi({
|
|
config,
|
|
url: DATA_URL,
|
|
})
|
|
|
|
return {
|
|
half: response?._p_half ?? 0,
|
|
second: response?._p_second ?? 0,
|
|
}
|
|
}
|
|
|