Skip to content

Commit

Permalink
feat: 피드 좋아요 HTTP method 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
BangDori committed Apr 17, 2024
1 parent fd8302d commit 44a1be3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/mocks/handler/like.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const likeHandlers = [
}),

// 2️⃣ 피드 좋아요
http.post('/feeds/:feed_id/likes', ({ params }) => {
http.put('/feeds/:feed_id/likes', ({ params }) => {
const { feed_id } = params;

if (isNaN(Number(feed_id))) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/mocks/test/like.error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios from 'axios';

const testCases = [
['GET', '피드 좋아요 조회 API'],
['POST', '피드 좋아요 API'],
['PUT', '피드 좋아요 API'],
['DELETE', '피드 좋아요 취소 API'],
];

Expand Down
4 changes: 2 additions & 2 deletions src/app/mocks/test/like.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('좋아요가 되어있지 않은 상태에서', () => {
const { totalCount: prevTotalCount } = await getFeedById(feedId);

// 좋아요 클릭
await axios.post(`/feeds/${feedId}/likes`);
await axios.put(`/feeds/${feedId}/likes`);

// 업데이트 된 좋아요의 상태
const { totalCount, isLike } = await getFeedById(feedId);
Expand Down Expand Up @@ -44,7 +44,7 @@ describe('좋아요가 되어있는 상태에서', () => {
const { totalCount: prevTotalCount, isLike: prevIsLike } =
await getFeedById(feedId);

await axios.post(`/feeds/${feedId}/likes`);
await axios.put(`/feeds/${feedId}/likes`);

const { totalCount, isLike } = await getFeedById(feedId);

Expand Down

0 comments on commit 44a1be3

Please sign in to comment.