From 41267bba5141f45997d06a78489c8b11700e7f3c Mon Sep 17 00:00:00 2001 From: Yeonwoo Sea <62321953+Village-GG-Water@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:23:22 +0900 Subject: [PATCH] fix: api.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit / 두 번 쳐짐 --- src/utils/api.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/api.js b/src/utils/api.js index 37fe8d6..f5f667f 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -68,23 +68,23 @@ api.interceptors.response.use( // API 요청 함수들 (GET, POST, PUT, DELETE) async function GET(endpoint, data = { headers: {} }) { - return await api.get(`/api/${endpoint}`, { headers: data.headers }); + return await api.get(`/api${endpoint}`, { headers: data.headers }); } async function POST(endpoint, data = { body: {}, headers: {} }) { - return await api.post(`/api/${endpoint}`, data.body, { + return await api.post(`/api${endpoint}`, data.body, { headers: data.headers, }); } async function PUT(endpoint, data = { body: {}, headers: {} }) { - return await api.put(`/api/${endpoint}`, data.body, { + return await api.put(`/api${endpoint}`, data.body, { headers: data.headers, }); } async function DELETE(endpoint, data = { headers: {} }) { - return await api.delete(`/api/${endpoint}`, { headers: data.headers }); + return await api.delete(`/api${endpoint}`, { headers: data.headers }); } export const API = {