import {
  DATA_URL,
  PROCEDURES,
  SportTypes,
} from 'config'
import { callApi } from 'helpers'

const proc = PROCEDURES.save_user_match_second

type Args = {
  half?: number,
  matchId: number,
  seconds: number,
  sport: SportTypes,
}

export const reportPlayerProgress = ({
  half,
  matchId,
  seconds,
  sport,
}: Args) => {
  const config = {
    body: {
      params: {
        _p_half: half,
        _p_match_id: matchId,
        _p_second: seconds,
        _p_sport: sport,
      },
      proc,
    },
  }

  callApi({
    config,
    url: DATA_URL,
  })
}
