-
Notifications
You must be signed in to change notification settings - Fork 1
branch: 관리자페이지 진입 및 공지사항 파트 UI + API 연동 #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
Visit the preview URL for this PR (updated for commit d0a0d7a): https://web-deploy-9d41a--pr71-feature-manager-vhxgm8dy.web.app (expires Wed, 26 Nov 2025 16:26:14 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 4a5d43964536093bf8932015bdd49b24c5b660ce |
whitecity01
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
컴포넌트 재사용을 위해 노력하신 점이 인상깊습니다.
현재 수정, 삭제에 대한 별다른 인터렉트가 없어서 살짝 아쉬운 부분이 있습니다.
나머지 리뷰 확인 부탁드립니다!
| const closeEditPage = () => navigate(-1); | ||
|
|
||
| useEffect(() => { | ||
| const fetchDetail = async () => { | ||
| try { | ||
| const res = await getAnnounceDetailAPI(id); | ||
| setTitle(res.title); | ||
| setContent(res.content); | ||
| } catch (err) { | ||
| alert("공지사항 정보를 불러오지 못했습니다."); | ||
| } finally { | ||
| setLoading(false); | ||
| } | ||
| }; | ||
| fetchDetail(); | ||
| }, [id]); | ||
|
|
||
| const handleSubmit = async () => { | ||
| try { | ||
| const notificationInfo = { id, title, content }; | ||
| await updateAnnounceAPI(notificationInfo); | ||
| navigate(`${ADMIN_ANNOUNCE_URL}/${id}`); | ||
| } catch (err) { | ||
| console.log(err); | ||
| alert("공지 수정에 실패했습니다."); | ||
| } | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
현재 수정 기능을 확인해보니,
navigate(url/id)로 수정 완료 시 상세 페이지로 이동하고,
나가기 버튼에서는 navigate(-1)을 사용하고 있습니다.
이 경우 수정 완료 시 새로운 히스토리가 추가되어,
나가기 버튼을 눌러도 동일한 상세 페이지가 연속해서 나타나는 현상이 발생합니다.
혹시 이런 히스토리 중첩이 의도된 동작인지 궁금합니다.
| const isAdminMode = | ||
| profile?.role === "ADMIN" && window.location.pathname.includes("admin"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이전 리뷰에 있듯 page loader 단에서 admin 필터를 적용한다면 추가 검증 절차가 없어져도 될 것 같습니다.
| <div className="announce-manage-button-bar"> | ||
| <Link | ||
| to={`${ADMIN_ANNOUNCE_URL}/${notificationId}/edit`} | ||
| className="button--edit" | ||
| > | ||
| 수정 | ||
| </Link> | ||
| <button className="button--delete" onClick={handleDelete}> | ||
| 삭제 | ||
| </button> | ||
| </div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- 두개로 하신 이유가 있을까요?


관리자 공지사항 파트 PR
개요
관리자(Admin) 기능 중 공지사항 파트를 구현했습니다.
관리자 진입 버튼 추가, 관리자 라우팅 구성, 관리자 홈 구축, 공지사항 CRUD 기능, UI 정리, API 연동 등을 포함합니다.
주요 변경사항
1. 관리자 진입 및 라우팅
2. 공지사항 관리자 모드
3. 공지사항 CRUD 구현
4. 라우팅 및 구조 개선
기타
스크린샷