Skip to content

Commit

Permalink
Merge pull request #56 from KERT-core/hotfix/api
Browse files Browse the repository at this point in the history
hotfix: GET/DELETE에서 body 전송 금지
  • Loading branch information
Village-GG-Water authored Oct 9, 2024
2 parents b9d25d4 + ab05994 commit cb925d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ async function request(endpoint, method = 'GET', data = null, headers = {}) {

// GET 요청
async function GET(endpoint, data = { body: {}, headers: {} }) {
return await request(endpoint, 'GET', data.body, data.headers);
// GET 요청은 body를 사용하지 않습니다.
return await request(endpoint, 'GET', null, data.headers);
}

// POST 요청
Expand All @@ -64,7 +65,8 @@ async function PUT(endpoint, data = { body: {}, headers: {} }) {

// DELETE 요청
async function DELETE(endpoint, data = { body: {}, headers: {} }) {
return await request(endpoint, 'DELETE', data.body, data.headers);
// DELETE 요청은 body를 사용하지 않습니다.
return await request(endpoint, 'DELETE', null, data.headers);
}

export const API = {
Expand Down

0 comments on commit cb925d7

Please sign in to comment.