Skip to content

Commit

Permalink
fix: 취소된 알림 + 이미지나간 알림 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
eun-hak committed Jun 11, 2024
1 parent f517f6d commit 42dd7eb
Showing 1 changed file with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
'use client';
import useOnClickOutside from '@/components/community/hooks/useOnClickOutside';
import { useReservationStore } from '@/store/reservationModal.store';
import React, { useRef } from 'react';
import React, { useEffect, useRef } from 'react';
import { useQuery } from 'react-query';
import { getReservationDetail } from '../../remote/myreservation';
import { format, isBefore, isSameDay, parseISO } from 'date-fns';
import { participantsType } from '../../model/myreservation';
import { ko } from 'date-fns/locale';
// import { useRouter } from 'next/navigation';
import { useRouter } from 'next/navigation';

const MeetingDetailModal = () => {
// const router = useRouter();
const router = useRouter();
const {
setOpen,
reservationId,
Expand All @@ -31,17 +31,20 @@ const MeetingDetailModal = () => {
}
);

// console.log(data?.status);
// console.log(data);
// /* eslint-disable */
// useEffect(() => {
// setLateDataTest(data?.data);
// console.log(LateDataTest);
// if (!LateDataTest) {
// alert('이미 종료된 일정입니다');
// router.push('/');
// }
// }, [data]);
console.log(data?.status);
console.log(data);
/* eslint-disable */
useEffect(() => {
if (data?.reservationProgress === 'AFTER_USE') {
alert('이미 종료된 일정입니다');
router.push('/');
setOpen(false);
} else if (data?.reservationStatus === 'CANCELED') {
alert('취소된 일정입니다');
router.push('/');
setOpen(false);
}
}, [data]);

if (data == undefined) {
return null;
Expand Down

0 comments on commit 42dd7eb

Please sign in to comment.