Commit 24fd71ae authored by Guillermo Sanz López's avatar Guillermo Sanz López
Browse files

add comments

parent c8b1fcad
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -9,9 +9,10 @@ const axiosInstance = axios.create({
  baseURL: process.env.NEXT_PUBLIC_API_BASE_URL   // http://10.95.82.71:8085 mi máquina en boe
})

// RESPONSE interceptor for API calls
// REQUEST interceptor for API calls -> if user is logged in, add token to headers of request
axiosInstance.interceptors.request.use(
  req => {
    // show log in development mode
    if (process.env.NODE_ENV === 'development') {
      if (req.data && DEBUG_SHOW_DATA) {
        console.log(`🔵 ${req.method.toUpperCase()} ${req.url}`, req.data)