Skip to content

Commit 3ae278d

Browse files
committed
[fix] mypage 401에러 대응
1 parent 733ce4f commit 3ae278d

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/domains/mypage/components/pages/my-active/MyLike.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function MyLike() {
88
const [isLoading, setIsLoading] = useState(false);
99

1010
const fetchLike = async () => {
11-
const res = await fetch(`${getApi}/me/likes/posts`, {
11+
const res = await fetch(`${getApi}/me/likes`, {
1212
method: 'GET',
1313
credentials: 'include',
1414
});

src/domains/mypage/components/pages/my-active/MyPost.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ function MyPost() {
1212
credentials: 'include',
1313
});
1414
const json = await res.json();
15+
console.log(json);
1516
setMyPost(json.data.items);
1617
};
1718

src/domains/recipe/components/details/RecipeComment.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ function RecipeComment({ cocktailId }: Props) {
2222
const { toastInfo } = useToast();
2323

2424
const postRecipeComment = async (cocktailId: number, content: string) => {
25-
2625
if (!user?.id) {
27-
toastInfo('로그인 후 이용 가능합니다');
28-
return
26+
toastInfo('로그인 후 이용 가능합니다');
27+
return;
2928
}
30-
29+
3130
try {
3231
const res = await fetch(`${getApi}/cocktails/${cocktailId}/comments`, {
3332
method: 'POST',
@@ -36,10 +35,10 @@ function RecipeComment({ cocktailId }: Props) {
3635
body: JSON.stringify({ content }),
3736
});
3837
const text = await res.text();
39-
40-
if (!res.ok) {
38+
39+
if (!res.ok) {
4140
toastInfo('댓글은 한 개만 작성가능합니다');
42-
return
41+
return;
4342
}
4443

4544
const data = JSON.parse(text);

src/domains/recipe/details/DetailMain.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function DetailMain({ id }: { id: number }) {
3232

3333
if (!user) {
3434
setIsKept(false);
35-
return
35+
return;
3636
} else {
3737
const keepRes = await fetch(`${getApi}/me/bar`, {
3838
method: 'GET',

0 commit comments

Comments
 (0)