Skip to content

feat: 댓글 전체 공개 상태 조회 구현#323

Merged
2yunseong merged 1 commit intomainfrom
feat/322-comments-disclosure
Feb 25, 2026
Merged

feat: 댓글 전체 공개 상태 조회 구현#323
2yunseong merged 1 commit intomainfrom
feat/322-comments-disclosure

Conversation

@2yunseong
Copy link
Collaborator

@2yunseong 2yunseong commented Feb 23, 2026

관련 이슈

작업 분류

  • 버그 수정
  • 신규 기능 추가
  • 프로젝트 구조 변경
  • 코드 스타일 변경
  • 기존 기능 개선
  • 문서 수정

PR을 통해 해결하려는 문제가 무엇인가요? 🚀

image

간단히 API 연동하였습니다! 추후 코드 개선이 필요합니다 :(

PR에서 핵심적으로 변경된 부분이 어떤 부분인가요? 👀

  • 신규 페이지가 추가되었습니다.

핵심 변경사항 이외 추가적으로 변경된 사항이 있나요? ➕

추가적으로, 리뷰어가 리뷰하며 알아야 할 정보가 있나요? 🙌

  • 코드가 좀 더러운데 편하게 리뷰 주세요! 감사합니다.

이런 부분을 신경써서 봐주셨으면 좋겠어요. 🙋🏻‍♂️

체크리스트 ✅

  • reviewers 설정
  • assignees 설정
  • label 설정

@2yunseong 2yunseong self-assigned this Feb 23, 2026
@2yunseong 2yunseong added the feature 기능개발 label Feb 23, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @2yunseong, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 관리자가 시스템 내 모든 댓글의 공개 상태를 전역적으로 제어할 수 있는 기능을 추가합니다. 이를 통해 관리자는 필요에 따라 댓글 기능을 활성화하거나 비활성화할 수 있으며, 사용자 경험에 영향을 미치는 중요한 설정을 유연하게 관리할 수 있게 됩니다.

Highlights

  • 댓글 공개 상태 관리 페이지 추가: 관리자가 댓글의 전체 공개 상태를 조회하고 변경할 수 있는 새로운 페이지를 프론트엔드에 구현했습니다.
  • 댓글 공개 API 연동: 댓글의 공개 상태를 가져오고 설정하는 새로운 API 함수를 추가하고, 이를 프론트엔드 페이지에 연동했습니다.
  • 관리자 탭 메뉴 업데이트: 관리자 페이지 내비게이션에 '댓글 전체 공개 on/off' 탭을 추가하여 새로운 기능에 쉽게 접근할 수 있도록 했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • frontend/app/(WithNavbar)/admin/[generation]/comments-disclosure/page.tsx
    • 댓글 공개 상태를 표시하고 변경하는 UI 컴포넌트가 추가되었습니다.
    • react-query를 사용하여 댓글 공개 상태를 조회하고 업데이트하는 로직이 구현되었습니다.
  • frontend/components/admin/AdminTabs.tsx
    • 관리자 탭 목록에 '댓글 전체 공개 on/off' 항목이 추가되어 새로운 페이지로의 링크를 제공합니다.
  • frontend/src/apis/comment/index.ts
    • 댓글의 현재 공개 상태를 가져오는 getCommentsDisclosure 함수가 추가되었습니다.
    • 댓글의 공개 상태를 설정하는 postCommentsDisclosure 함수가 추가되었습니다.
Activity
  • 댓글 전체 공개 상태를 관리하는 신규 기능이 추가되었습니다.
  • API 연동이 완료되었으며, 추후 코드 개선이 필요하다는 코멘트가 있었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@2yunseong 2yunseong requested a review from jskimcs February 23, 2026 16:14
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

댓글 공개 상태 조회 및 변경 기능을 위한 관리자 페이지와 API 연동이 잘 구현되었습니다. 다만, TanStack Query의 최신 문법 대응과 API 요청 시의 데이터 타입 처리 방식에 대해 몇 가지 개선 사항을 제안드립니다.

Comment on lines +13 to +16
const { data, isLoading, isError } = useQuery(
QUERY_KEY,
getCommentsDisclosure
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

TanStack Query v5 이상을 사용 중이라면 useQuery의 인자를 객체 형태({ queryKey, queryFn })로 전달해야 합니다. 현재의 방식은 v4 이하의 문법이므로, 프로젝트의 라이브러리 버전에 맞춰 최신 문법을 적용하는 것을 권장합니다.

Suggested change
const { data, isLoading, isError } = useQuery(
QUERY_KEY,
getCommentsDisclosure
);
const { data, isLoading, isError } = useQuery({
queryKey: QUERY_KEY,
queryFn: getCommentsDisclosure,
});

Comment on lines +18 to +28
const { mutate: updateDisclosure, isLoading: isUpdating } = useMutation(
postCommentsDisclosure,
{
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: QUERY_KEY });
},
onError: () => {
alert("댓글 공개 상태 변경에 실패했습니다. 잠시 후 다시 시도해주세요.");
},
}
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

useMutation 또한 v5에서는 객체 형태의 인자를 사용하며, isLoading 속성은 isPending으로 변경되었습니다. 일관성 있는 최신 문법 사용을 권장합니다.

  const { mutate: updateDisclosure, isLoading: isUpdating } = useMutation({
    mutationFn: postCommentsDisclosure,
    onSuccess: () => {
      queryClient.invalidateQueries({ queryKey: QUERY_KEY });
    },
    onError: () => {
      alert("댓글 공개 상태 변경에 실패했습니다. 잠시 후 다시 시도해주세요.");
    },
  });

export const postCommentsDisclosure = async (isDisclosure: boolean) => {
const { data } = await https.post<boolean | string>(
`/comments/disclosure`,
`${isDisclosure}`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

isDisclosure를 템플릿 리터럴을 사용하여 문자열로 변환하여 전송하고 있습니다. axios 인스턴스 설정에서 Content-Typeapplication/json으로 설정되어 있으므로, 불리언 값 자체를 전달하여 JSON 표준 타입을 따르는 것이 더 적절합니다.

Suggested change
`${isDisclosure}`
isDisclosure

Copy link
Collaborator

@cho-in-sik cho-in-sik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 !
현재 네브바가 role이 관리자(ROLE_OPERATION)가 아니라면 보이지 않아서 회장단은 접근이 불가합니다. 롤을 추가하거나 회장단 페이지가 새로 있어야 할것 같다는 생각이 듭니다! 더 좋은 방법 있으면 알려주세요!

Image

@2yunseong 2yunseong merged commit e3d2452 into main Feb 25, 2026
1 check passed
@2yunseong 2yunseong deleted the feat/322-comments-disclosure branch February 25, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature 기능개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FE] feat: 코멘트 전체 공개 상태 조회 및 Toggle 설정

2 participants