import { API_ROOT } from 'config'
import { callApi } from 'helpers'

export type LandingMedia = {
  logo_url: string,
}

type Args = {
  sport_id: number,
  tournament_id?: number,
}

export const getLandingLogo = async ({
  sport_id,
  tournament_id,
}: Args): Promise<LandingMedia> => {
  const config = {
    method: 'GET',
  }

  return callApi({
    config,
    url: `${API_ROOT}/v1/tournaments/${sport_id}/${tournament_id}/media`,
  })
}
