Skip to content
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

[Feature] 스터디 조회 v2 api로 변경, 삭제 기능 추가 #183

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

chocoboy08
Copy link

@chocoboy08 chocoboy08 commented Mar 5, 2025

🎉 변경 사항

스터디 조회 v2 api를 적용하고, 진행학기 별 필터링 기능을 추가했습니다.
스터디 삭제 기능을 추가했습니다.

🚩 관련 이슈

DropDown 컴포넌트에서 aria-hidden 속성 관련 에러가 발생합니다.

@chocoboy08 chocoboy08 linked an issue Mar 5, 2025 that may be closed by this pull request
3 tasks
@chocoboy08 chocoboy08 added the ⛏어드민 어드민 페이지 작업 label Mar 5, 2025
@chocoboy08 chocoboy08 changed the title [Feature] 스터디 조회 v2 api로 변경 [Feature] 스터디 조회 v2 api로 변경, 삭제 기능 추가 Mar 6, 2025
const DeleteStudyCheckModal = ({ params }: { params: { studyId: number } }) => {
const { parseQueryString } = useParseSearchParams();
const searchParams = useSearchParams();
const router = useRouter();
Copy link
Collaborator

Choose a reason for hiding this comment

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

p4;
라우터는 사용되지 않은것같아요

Copy link
Author

Choose a reason for hiding this comment

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

헉 제거하겠습니다

<DropDown
defaultValue={querySemester ? querySemester : "all"}
style={{ width: "6.5rem" }}
onChange={({ selectedValue }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

p4;
handler 함수로 변경하는것도 좋아보입니다

useEffect(() => {
if (semester && semesterList && !semesterList?.includes(semester))
router.replace("/studies");
}, [semester, studyList]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

p2;
useEffect의 디펜던시 리스트에 semesterList 가 있어야 할 것 같아요

Copy link
Collaborator

@SeieunYoo SeieunYoo left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~~~

Comment on lines 24 to 29
const handleClickDeleteButton = async () => {
const result = await studyApi.deleteStudy(params.studyId);
if (result.success) {
onClose();
}
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

p3;
모달에 delay 를 주고 닫는 플로우가 더 자연스러울 거 같아요! 보통 1000ms 정도 주면 좋을 거 같아요

setTimeout(() => {
      onClose();
    }, MODAL_DELAY_TIME);

Comment on lines 25 to 27
const result = await studyApi.deleteStudy(params.studyId);
if (result.success) {
onClose();
Copy link
Collaborator

Choose a reason for hiding this comment

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

p3;
delete 이후에 스터디 목록 업데이트를 위해 revalidsteTag 로 다시 api fetch 를 하면 좋을 거 같아요.

     await revalidateTagByName(tags.studyList);
      await revalidateTagByName(tags.myStudyList);

Comment on lines +25 to +27
(semester === null ||
semester ===
`${studyItem.study.semester.academicYear}-${studyItem.study.semester.semesterType === "FIRST" ? 1 : 2}`) && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

p4;
semester 값에 따른 렌더링 조건이 추가된 이유가 있을까요?

Copy link
Author

Choose a reason for hiding this comment

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

드롭다운에서 선택된 학기와 일치하는 스터디만 필터링 하기 위해서 추가했습니다!

Comment on lines 59 to 65
<Link
href={`${routerPath["delete-study-check"].href}/${studyId}?${querySemester ? `semester=${querySemester}&` : ""}title=${title}&academicYear=${semester.academicYear}&semesterType=${semester.semesterType}`}
>
<Button size="sm" variant="outline">
스터디 삭제
</Button>
</Link>
Copy link
Collaborator

@SeieunYoo SeieunYoo Mar 11, 2025

Choose a reason for hiding this comment

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

p4;
Button 컴포넌트에 asProp 을 통해 커스텀 하고자 하는 태그를 전달할 수 있어요!

<Button asProp = {Link}  href={link} />

Comment on lines +12 to +24
useEffect(() => {
const fetchStudyListData = async () => {
const admin = await isAdmin();
const studyList = admin
? await studyApi.getStudyList()
: await studyApi.getMyStudyList();

setStudyList(studyList);
setAdminStatus(admin);
};

fetchStudyListData();
}, [pathName]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

p4;
여기 pathName 을 디펜던시로 넣은 이유가 있을까요?

Copy link
Author

Choose a reason for hiding this comment

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

스터디 삭제 후 모달이 닫힐 때 스터디 목록 업데이트와 리렌더링을 위해 넣었습니다..!

Comment on lines 17 to 22
startTime: {
hour: number;
minute: number;
second: number;
nano: number;
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

p3;
startTime 과 endTime 은 TImeType 을 활용하는 게 좋을 거 같아요!

Copy link
Author

Choose a reason for hiding this comment

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

확인 못했었네요.. 반영하겠습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] 스터디 목록 조회 및 삭제
3 participants