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

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

module.exports = { isEditable };
