Skip to content

Commit

Permalink
Fix: fix removecookie issue #165
Browse files Browse the repository at this point in the history
  • Loading branch information
HOOOO98 committed Jan 27, 2024
1 parent 5d9fc04 commit 16f3d57
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/Modal/Invitation/Invitation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {InvitationProps} from '@/types/Invitation';

function Invitation({inviteCode, modal}: InvitationProps) {
const [isFull, setIsFull] = useRecoilState(isFullMember);
const [, , removeCookie] = useCookies(['join_space_token']);
const [, setcookie] = useCookies(['join_space_token']);
const {data} = useGetMyInfo(true);
const navigate = useNavigate();
const parsedInviteCode = parseInviteCode(inviteCode);
Expand All @@ -33,10 +33,10 @@ function Invitation({inviteCode, modal}: InvitationProps) {
const handleJoin = async () => {
const response = await postJoin(parsedInviteCode!.space_id);
if (response.status === 200) {
removeCookie('join_space_token');
setcookie('join_space_token', '');
navigate(`/trip/${parsedInviteCode!.space_id}`);
} else if (response.status === 400) {
removeCookie('join_space_token');
setcookie('join_space_token', '');
modal(false);
setIsFull(true);
}
Expand All @@ -62,7 +62,7 @@ function Invitation({inviteCode, modal}: InvitationProps) {
className={styles.wrapperInvalidButton__confirm}
onClick={() => {
modal(false);
removeCookie('join_space_token');
setcookie('join_space_token', '');
}}
>
확인
Expand All @@ -87,7 +87,7 @@ function Invitation({inviteCode, modal}: InvitationProps) {
className={styles.wrapperButton__cancel}
onClick={() => {
modal(false);
removeCookie('join_space_token');
setcookie('join_space_token', '');
}}
>
취소
Expand All @@ -114,7 +114,7 @@ function Invitation({inviteCode, modal}: InvitationProps) {
className={styles.wrapperButton__cancel}
onClick={() => {
modal(false);
removeCookie('join_space_token');
setcookie('join_space_token', '');
}}
>
취소
Expand Down

0 comments on commit 16f3d57

Please sign in to comment.