const fetchAll = axios.create({
headers: {
'Content-Type': 'application/json',
'Authorization': process.env.TOKEN,
},
withCredentials: true,
});
fetchAll.interceptors.response.use(response => {
console.log('yeeeeeeeeeeeeeeeeeeeeeeeee');
console.log(response);
return response;
}, error => {
console.log('fuuuuuuuuuuuucccccccckkkkkkkkkk');
console.log(error);
return Promise.reject(error);
});
const onClick = e => {
const receiveId = e.target.dataset.id;
console.log("came " + receiveId + "; " + "active " + active);
if (receiveId === active) {
console.log("Set null");
setActive(null);
} else {
console.log("Set " + receiveId);
setActive(receiveId);
}
};