Update api.js

This commit is contained in:
Andrean
2023-05-08 16:51:12 +00:00
committed by GitHub
parent 58dd8286c9
commit 6fe27c91d5
-15
View File
@@ -2,27 +2,12 @@ import axios from 'axios';
import store from '../store';
import { LOGOUT } from '../actions/types';
<<<<<<< HEAD
// Create an instance of axios
=======
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
const api = axios.create({
baseURL: '/api',
headers: {
'Content-Type': 'application/json'
}
});
<<<<<<< HEAD
/*
NOTE: intercept any error responses from the api
and check if the token is no longer valid.
ie. Token has expired or user is no longer
authenticated.
logout the user if the token has expired
*/
=======
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
api.interceptors.response.use(
(res) => res,
(err) => {