const axios = require('../../axios');

async function get(url, params) {
  try {
    const { data } = await axios.get(url, {
      params,
    });
    return data;
  } catch (e) {
    throw new Error(`${e.response.status} ${e.response.statusText}`);
  }
}

module.exports = get;
