Skip to content

Commit ae4bf0b

Browse files
authored
Merge pull request #82 from N-NProject/feat/#81
[feat] 채팅방 입장 제한하기
2 parents 759cc35 + c458004 commit ae4bf0b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

my-app/src/app/post/[slug]/page.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@ const Post = ({ params }: { params: { slug: number } }) => {
9090
};
9191

9292
const clickJoinButton = () => {
93-
joinMutation.mutate(params.slug);
93+
if (postData.status === "CLOSE") {
94+
alert("해당 모집글은 기간이 종료되어 참여 불가능합니다.");
95+
} else if (currentPerson === postData.maxCapacity) {
96+
alert("해당 모집글은 인원이 마감되어 참여 불가능합니다.");
97+
} else {
98+
joinMutation.mutate(params.slug);
99+
}
94100
};
95101

96102
const loadKakaoMap = (latitude: string, longitude: string) => {

0 commit comments

Comments
 (0)