Skip to content

Commit

Permalink
rename: useGetMyScheduleQuery 훅을 schedule 관련 파일로 이동 (meeting → schedule)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoonkyoungme committed Oct 11, 2024
1 parent 1a9566e commit b239066
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Mode } from 'types/schedule';

import { AuthContext } from '@contexts/AuthProvider';

import { useGetMyScheduleQuery } from '@stores/servers/meeting/queries';
import { useGetMyScheduleQuery } from '@stores/servers/schedule/queries';

import SchedulePicker from '.';

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/useCalendarPick/useCalendarPick.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';

import { useGetMyScheduleQuery } from '@stores/servers/meeting/queries';
import { useGetMyScheduleQuery } from '@stores/servers/schedule/queries';

export default function useCalendarPick(uuid: string, userName: string) {
const { data: meetingSchedules, isSuccess } = useGetMyScheduleQuery(uuid, userName);
Expand Down
8 changes: 0 additions & 8 deletions frontend/src/stores/servers/meeting/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useQuery } from '@tanstack/react-query';

import { getMeetingBase, getMeetingInvitationDetails } from '@apis/meetings/meetings';
import { getMeetingTimeRecommends } from '@apis/meetings/recommends';
import { getMeetingMySchedule } from '@apis/schedules';

import { QUERY_KEY } from '@constants/queryKeys';

Expand Down Expand Up @@ -32,13 +31,6 @@ export const useGetMeetingRecommendsQuery = ({
refetchOnWindowFocus: false,
});

export const useGetMyScheduleQuery = (uuid: string, userName: string) =>
useQuery({
queryKey: [QUERY_KEY.meetingMySchedule, { userName }],
queryFn: () => getMeetingMySchedule(uuid),
staleTime: 0,
});

export const useMeetingInvitationDetailQuery = (uuid: string) => {
return useQuery({
queryKey: [QUERY_KEY.meetingInvitationDetails],
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/stores/servers/schedule/queries.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useQuery } from '@tanstack/react-query';

import { handleGetMeetingSchedules } from '@apis/schedules';
import { getMeetingMySchedule, handleGetMeetingSchedules } from '@apis/schedules';

import { QUERY_KEY } from '@constants/queryKeys';

Expand All @@ -10,3 +10,10 @@ export const useGetSchedules = (uuid: string, selectedAttendee: string) =>
queryFn: () => handleGetMeetingSchedules({ uuid, attendeeName: selectedAttendee }),
staleTime: 0,
});

export const useGetMyScheduleQuery = (uuid: string, userName: string) =>
useQuery({
queryKey: [QUERY_KEY.meetingMySchedule, { userName }],
queryFn: () => getMeetingMySchedule(uuid),
staleTime: 0,
});

0 comments on commit b239066

Please sign in to comment.