Skip to content

Commit

Permalink
Merge pull request #70 from KERT-core/fix/api
Browse files Browse the repository at this point in the history
fix: api.js
  • Loading branch information
Village-GG-Water authored Nov 5, 2024
2 parents 021e86e + 41267bb commit 9a1a070
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 9a1a070

Please sign in to comment.