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

async function autoClear(token) {
  const response = await axios
    .get(`${process.env.backend_url}/api/clear-monthly`, {
      headers: {
        Authorization: `Bearer ${token}`,
      },
    })
    .catch(e => {
      // eslint-disable-next-line no-console
      // console.log(e);
      console.log("error pull auto-clear settings");
    });
  return response ? response.data.data : null;
}

module.exports = { autoClear };
