11import { useEffect , useState } from 'react' ;
22import { useNavigate , useParams } from 'react-router-dom' ;
3- import dayjs from 'dayjs' ;
4-
53import { useRecoilState } from 'recoil' ;
64import { selectedMethodState } from '@/atoms/selectedMethodAtom' ;
75
@@ -35,7 +33,6 @@ import { initialRoomInfoData } from '@/assets/data/initialRoomInfoData';
3533
3634import { useAuth } from '@/hooks/useAuth' ;
3735import { ROUTES } from '@/constants/ROUTES' ;
38- import { getFourChunks } from '@/utils/getFourChunks' ;
3936import { useGetRoomInfo } from '@/queries/room/useGetRoomInfo' ;
4037
4138import { Participant , RoomTypes } from '@/types/roomInfo' ;
@@ -49,7 +46,6 @@ import { useQueryClient } from '@tanstack/react-query';
4946import { QUERY_KEYS } from '@/constants/QUERY_KEYS' ;
5047import { Helmet } from 'react-helmet-async' ;
5148import { useGetAvailableTimeOverview } from '@/queries/availableTimes/useGetAvailableTimeOverview' ;
52- import { useGetAvailableTimesByGroup } from '@/queries/availableTimes/useGetAvailableTimesByGroup' ;
5349import { UpdateNote } from '@/components/commons/updateNote' ;
5450import { getFormattedDateArray } from '@/utils/getFormattedDateArray' ;
5551import { Loading } from '@/components/commons/loading' ;
@@ -75,10 +71,6 @@ const Current = () => {
7571 const [ selectedParticipants , setSelectedParticipants ] = useState <
7672 Participant [ ]
7773 > ( [ ] ) ;
78- const { data : timeInfo } = useGetAvailableTimesByGroup (
79- roomUUID ,
80- selectedParticipants . length === 0
81- ) ;
8274 const { data : availableTimeOverview } = useGetAvailableTimeOverview ( {
8375 roomId : roomUUID ,
8476 participants : selectedParticipants . map ( ( p ) => p . name ) ,
@@ -169,8 +161,8 @@ const Current = () => {
169161 roomUUID ,
170162 ] ) ;
171163 queryClient . invalidateQueries ( [
172- QUERY_KEYS . AVAILABLE_TIME . GET_AVAILABLE_TIMES_BY_GROUP ,
173- roomUUID ,
164+ `roomId= ${ roomUUID } ` ,
165+ `availableTimeOverview` ,
174166 ] ) ;
175167 queryClient . invalidateQueries ( [
176168 QUERY_KEYS . RESULT . GET_CANDIDATE_TIMES ,
@@ -314,20 +306,12 @@ const Current = () => {
314306 < Title > 실시간 등록 현황</ Title >
315307 { isTableView ? (
316308 < TableWrapper >
317- { (
318- selectedParticipants . length > 0
319- ? availableTimeOverview
320- : timeInfo
321- ) ? (
309+ { availableTimeOverview ? (
322310 < Table
323311 dates = { getFormattedDateArray ( dates ) }
324312 startTime = { startTime }
325313 endTime = { endTime }
326- timeInfo = {
327- selectedParticipants . length > 0
328- ? availableTimeOverview
329- : timeInfo
330- }
314+ timeInfo = { availableTimeOverview }
331315 participants = {
332316 selectedParticipants . length > 0
333317 ? selectedParticipants
@@ -340,11 +324,7 @@ const Current = () => {
340324 </ TableWrapper >
341325 ) : (
342326 < CurrentCalendar
343- timeInfo = {
344- selectedParticipants . length > 0
345- ? availableTimeOverview
346- : timeInfo
347- }
327+ timeInfo = { availableTimeOverview }
348328 defaultActiveStartDate = {
349329 data . dates ?. [ 0 ] ? new Date ( data . dates [ 0 ] ) : new Date ( )
350330 }
0 commit comments