File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1- import axios from '../utils/axios'
1+ import axiosInstance from '../utils/axios'
22
33export const getNotifications = async ( ) => {
4- const response = await axios . get ( '/api/notifications?page=0&size=5' )
4+ const response = await axiosInstance . get ( '/api/notifications?page=0&size=5' )
55 return response . data
66}
77
88export const postLogin = async ( nickname : string , password : string ) => {
9- const response = await axios . post ( '/api/auths/login' , { nickname, password } )
9+ const response = await axiosInstance . post ( '/api/auths/login' , { nickname, password } )
1010 return response . data
1111}
1212
1313export const patchReadNotification = async ( notificationId : number ) => {
14- const response = await axios . patch ( `/api/notification/${ notificationId } ` )
14+ const response = await axiosInstance . patch ( `/api/notification/${ notificationId } ` )
1515 return response . data
1616}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import axios, { type InternalAxiosRequestConfig } from 'axios'
22import Cookies from 'js-cookie'
33const baseURL = import . meta. env . VITE_API_BASE_URL
44
5- const instance = axios . create ( {
5+ const axiosInstance = axios . create ( {
66 baseURL : baseURL ,
77 withCredentials : true ,
88 headers : {
@@ -11,7 +11,7 @@ const instance = axios.create({
1111 }
1212} )
1313
14- instance . interceptors . request . use (
14+ axiosInstance . interceptors . request . use (
1515 ( config : InternalAxiosRequestConfig ) => {
1616 if ( typeof window !== 'undefined' ) {
1717 const token = Cookies . get ( 'accessToken' )
@@ -24,7 +24,7 @@ instance.interceptors.request.use(
2424 error => Promise . reject ( error )
2525)
2626
27- instance . interceptors . response . use (
27+ axiosInstance . interceptors . response . use (
2828 response => response ,
2929 error => {
3030 if ( axios . isCancel ( error ) ) {
@@ -55,4 +55,4 @@ instance.interceptors.response.use(
5555 }
5656)
5757
58- export default instance
58+ export default axiosInstance
You can’t perform that action at this time.
0 commit comments