Skip to content

Commit

Permalink
fix: stash file
Browse files Browse the repository at this point in the history
  • Loading branch information
eun-hak committed Jun 11, 2024
1 parent 7c9c8e8 commit 83ffe31
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import React from 'react';
import React, { useEffect } from 'react';
import MyReservationHeader from './MyReservationHeader';
import MyReservationNav from './MyReservationNav';
import TodayReservation from './TodayReservation';
Expand All @@ -8,10 +8,32 @@ import FRDetailModal from './modal/FRDetailModal';
import MeetingDetailModal from './modal/MeetingDetailModal';
import ReservationDeleteModal from './modal/ReservationDeleteModal';
import ExpectedReservationIndex from './expectedReservation/ExpectedReservationIndex';
import { getReservationDetail } from '../remote/myreservation';
import { useQuery } from 'react-query';

const MyReservationListIndex = () => {
const { open, reservationId, isMeeting, deleteOpen, deleteDeskId } =
useReservationStore();

const { data } = useQuery(
['reservationDetail', reservationId],
async () => await getReservationDetail(reservationId),
{
enabled: reservationId != null
}
);

useEffect(() => {
console.log(data);
// if (!LateDataTest) {
// alert('이미 종료된 일정입니다');
// router.push('/');
// }
}, [data]);

if (data == undefined) {
return null;
}
return (
<div className="mb-[100px] ">
<header>
Expand Down
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, { useEffect, useRef, useState } from 'react';
import React, { 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 @@ -22,7 +22,7 @@ const MeetingDetailModal = () => {
const ref = useRef<HTMLDivElement>(null);
useOnClickOutside(ref, () => setOpen(false));

const [LateDataTest, setLateDataTest] = useState('');
// const [LateDataTest, setLateDataTest] = useState('');
const { data } = useQuery(
['reservationDetail', reservationId],
async () => await getReservationDetail(reservationId),
Expand All @@ -33,19 +33,19 @@ const MeetingDetailModal = () => {

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

if (data == undefined) {
return null;
}
// if (data == undefined) {
// return null;
// }

const date =
data && data.startAt
Expand Down
2 changes: 1 addition & 1 deletion src/pages/notification/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Notification = () => {
const { todayNotifications, pastNotifications } = categorizeNotifications(
allPosts || []
);
console.log(allPosts);

return (
<div className=" max-w-[393px] mx-auto relative">
<Footer />
Expand Down

0 comments on commit 83ffe31

Please sign in to comment.