diff --git a/src/apis/applications/index.ts b/src/apis/applications/index.ts index 37de771..8031962 100644 --- a/src/apis/applications/index.ts +++ b/src/apis/applications/index.ts @@ -1,9 +1,9 @@ -import { useMutation } from "@tanstack/react-query"; +import { useMutation, useQuery } from "@tanstack/react-query"; import { useToastStore } from "@team-return/design-system"; import { AxiosError } from "axios"; import { useRouter } from "next/navigation"; import { instance } from "../axios"; -import { ApplyRequestItmeType } from "./type"; +import { ApplicationsResponseType, ApplyRequestItmeType } from "./type"; const router = "/applications"; @@ -52,10 +52,8 @@ export default function useApplyToCompany(recruitmentId: string) { ); } -import { useQuery } from "@tanstack/react-query"; -import { ApplicationsResponseType } from "./type"; -export function GetApplications() { +export function useGetApplications() { return useQuery(["GetApplications"], async () => { const { data } = await instance.get( `${router}/students` diff --git a/src/apis/code/index.ts b/src/apis/code/index.ts index c7264ce..a82299c 100644 --- a/src/apis/code/index.ts +++ b/src/apis/code/index.ts @@ -1,6 +1,6 @@ -import { CodeType, GetCodeType } from "./type"; import { useQuery } from "@tanstack/react-query"; import axios from "axios"; +import { CodeType, GetCodeType } from "./type"; const router = "/codes"; diff --git a/src/apis/recruitments/index.ts b/src/apis/recruitments/index.ts index 867af7c..feaf54b 100644 --- a/src/apis/recruitments/index.ts +++ b/src/apis/recruitments/index.ts @@ -4,7 +4,7 @@ import { instance } from "../axios"; import { GetNumberOfPagesType, RecruitmentsDetailType, - RecruitmentsListResponseType, + RecruitmentsListResponseType } from "./type"; const router = "/recruitments"; diff --git a/src/apis/reviews/index.ts b/src/apis/reviews/index.ts index c81b4c5..6635fdd 100644 --- a/src/apis/reviews/index.ts +++ b/src/apis/reviews/index.ts @@ -2,7 +2,7 @@ import { useQuery } from "@tanstack/react-query"; import { instance } from "../axios"; import { getReviewDetailResponseProps, - getReviewListResponseProps, + getReviewListResponseProps } from "./type"; const router = "/reviews"; diff --git a/src/components/mypage/AppliedCompaniesList.tsx b/src/components/mypage/AppliedCompaniesList.tsx index bf474ec..fe9d0d9 100644 --- a/src/components/mypage/AppliedCompaniesList.tsx +++ b/src/components/mypage/AppliedCompaniesList.tsx @@ -1,12 +1,12 @@ "use client"; -import { GetApplications } from "@/apis/applications"; +import { useGetApplications } from "@/apis/applications"; import APpliedCompanyItem from "./AppliedICompanyItem"; import Docs from "@public/Docs.svg"; import Image from "next/image"; export default function AppliedCompaniesList() { - const { data: applications } = GetApplications(); + const { data: applications } = useGetApplications(); return (
diff --git a/src/components/mypage/DetailProfile.tsx b/src/components/mypage/DetailProfile.tsx index 31c9b6d..af85b8f 100644 --- a/src/components/mypage/DetailProfile.tsx +++ b/src/components/mypage/DetailProfile.tsx @@ -1,6 +1,6 @@ "use client"; -import { MyProfile } from "@/apis/students"; +import { useMyProfile } from "@/apis/students"; import { departmentEnum } from "@/util/object/enum"; import { getMypageKebabItems } from "@/util/object/kebabMenuItems"; import Image from "next/image"; @@ -8,7 +8,7 @@ import KebabMenu from "../common/Dropdown/KebabMenu"; import GhostTag from "./GhostTag"; export default function DetailProfile() { - const { data: profile } = MyProfile(); + const { data: profile } = useMyProfile(); return (