const baseUrl = '/api'
// const baseUrl = 'http://127.0.0.1:8021'

export function getNews(v: string) {
  return fetch(baseUrl + '/v1/article/index' + '?cid=8&language=' + v, {
      method: 'GET',
      headers: {
          "content-type": 'application/json'
      }
  }).then(ret => {
      return ret.json()
  })
}

export function getNewsDetails(id: number, v: string) {
  return fetch(baseUrl + `/v1/article/view?id=${id}&language=${v}`, {
      method: 'GET',
      headers: {
          "content-type": 'application/json'
      }
  }).then(ret => {
      return ret.json()
  })
}