Skip to content

Commit

Permalink
Merge pull request #44 from team-Ollie/15-feature-Calendar-Detail-Modal
Browse files Browse the repository at this point in the history
15 feature calendar detail modal
  • Loading branch information
leejin-rho authored Jul 2, 2024
2 parents 7094196 + 69efea3 commit cd26e9f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apis/hooks/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ const useGetMonthCalendar = () => {
};

const useGetProgramDetail = (programIdx: number) => {
const { data } = useQuery({
const { data, isLoading } = useQuery({
queryKey: ["getProgramDetail"],
queryFn: () => getProgramDetail(programIdx),
});
return { data };
return { data, isLoading };
};

export { useGetMonthCalendar, useGetProgramDetail };
7 changes: 5 additions & 2 deletions components/calendar/CalendarModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ const CalendarModal = ({
programIdx: number;
toggleModal: () => void;
}) => {
const { data }: { data: GetProgramDetailBody } =
useGetProgramDetail(programIdx);
const { data, isLoading } = useGetProgramDetail(programIdx);

if (isLoading) {
return <div>Loading...</div>;
}

return (
data && (
Expand Down
1 change: 0 additions & 1 deletion pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const Login: NextPage = () => {
mutationKey: ["SignIn"],
mutationFn: SignIn,
onSuccess: async (data) => {
console.log(data);
const accessToken = data.result.accessToken;
const refreshToken = data.result.refreshToken;
const isAdmin = data.result.isAdmin;
Expand Down

0 comments on commit cd26e9f

Please sign in to comment.