fix: axios header 추가

This commit is contained in:
Daseul Kim 2025-07-02 18:03:39 +09:00
parent a49e42687b
commit 1a6968abd1

View File

@ -1,12 +1,13 @@
import { useSpinnerStore } from '@/store/spinnerStore'
import axios from 'axios'
export const axiosInstance = (url: string | null | undefined) => {
export const axiosInstance = (url: string | null | undefined, headers?: Record<string, string>) => {
const baseURL = url || process.env.NEXT_PUBLIC_API_URL
const instance = axios.create({
baseURL,
headers: {
Accept: 'application/json',
...headers,
},
})