Skip to content

Commit 2a783d6

Browse files
committed
오류 수정
1 parent 1cba59c commit 2a783d6

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/domains/community/api/fetchComment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const postComments = async (postId: number | ParamValue, content: string)
4949

5050
export async function updateComment(
5151
accessToken: string | null,
52-
postId: number,
52+
postId: number | ParamValue,
5353
commentId: number,
5454
content: string
5555
): Promise<void> {
@@ -71,7 +71,7 @@ export async function updateComment(
7171

7272
export async function deleteComment(
7373
accessToken: string | null,
74-
postId: number,
74+
postId: number | ParamValue,
7575
commentId: number
7676
): Promise<void> {
7777
const response = await fetch(`${getApi}/posts/${postId}/comments/${commentId}`, {

src/domains/community/hook/useComment.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ export function useComments(postId: ParamValue, user: User | null, accessToken:
99
const [comments, setComments] = useState<CommentType[] | null>(null);
1010
const [isEnd, setIsEnd] = useState(false);
1111
const [isLoading, setIsLoading] = useState(false);
12-
const [deleteTarget, setDeleteTarget] = useState<{ commentId: number; postId: number } | null>(
13-
null
14-
);
12+
const [deleteTarget, setDeleteTarget] = useState<{
13+
commentId: number;
14+
postId: number | ParamValue;
15+
} | null>(null);
1516

1617
const fetchData = useCallback(async () => {
1718
const data = await fetchComment(postId);

0 commit comments

Comments
 (0)