Skip to content

Commit

Permalink
refactor: 댓글 작성시 Id 값 상수로 고정
Browse files Browse the repository at this point in the history
  • Loading branch information
semnil5202 committed Mar 7, 2024
1 parent 5320154 commit ec698ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const BASE_URL = 'http://localhost:8080';

// 서버 작업으로 인한 임시 상수값
export const PARENT_COMMENT_ID = '0';
export const ROOT_COMMENT_ID = '0';

export const DEFAULT_IMAGE_URL = '';
4 changes: 2 additions & 2 deletions src/pages/FeedDetail/components/WriteComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Box, Button, Divider, Flex, Text, theme } from 'concept-be-design-syste
import { ChangeEvent, useState } from 'react';

import WriteCommentProfileInfo from './WriteCommentProfileInfo';
import { PARENT_COMMENT_ID } from '../../../constants';
import { ROOT_COMMENT_ID } from '../../../constants';
import { useFocusCommentTextareaContext } from '../contexts/CommentFocusContext';
import usePostCommentMutation from '../hooks/mutations/usePostCommentMutation';

Expand Down Expand Up @@ -40,7 +40,7 @@ const WriteComment = ({ feedId, myImageUrl, myNickname }: Props) => {
};

const onSubmitComment = () => {
postComment({ ideaId: feedId, parentId: PARENT_COMMENT_ID, content: commentInput });
postComment({ ideaId: feedId, parentId: ROOT_COMMENT_ID, content: commentInput });
};

return (
Expand Down

0 comments on commit ec698ef

Please sign in to comment.