diff --git a/src/api/axiosClient.js b/src/api/axiosClient.js index 96e8599..6829b42 100644 --- a/src/api/axiosClient.js +++ b/src/api/axiosClient.js @@ -8,16 +8,6 @@ const createClient = (baseURL, withBaseFormat = false) => { headers: { 'Content-Type': 'application/json', Accept: 'application/json' } }); - client.interceptors.request.use((config) => { - const token = typeof window !== 'undefined' ? localStorage.getItem('token') : null; - if (token) { - config.headers = config.headers ?? {}; - config.headers.Authorization = `Bearer ${token}`; - } - - return config; - }); - if (withBaseFormat) { client.interceptors.response.use( (response) => diff --git a/src/components/ListVirtual.jsx b/src/components/ListVirtual.jsx index 4301303..8aff159 100644 --- a/src/components/ListVirtual.jsx +++ b/src/components/ListVirtual.jsx @@ -33,6 +33,7 @@ export default function ListVirtual({ helperText, filter, isApiGo = false, + headersRequest, }) { const [open, setOpen] = useState(false); const [search, setSearch] = useState(""); @@ -72,7 +73,10 @@ export default function ListVirtual({ url, payload.build(), {}, - { isApiGo } + { + isApiGo, + headers: headersRequest + } ); const incomingData = res.data || []; @@ -125,7 +129,10 @@ export default function ListVirtual({ url, payload.build(), {}, - { isApiGo } + { + isApiGo, + headers: headersRequest + } ); const data = res.data?.[0];