Skip to content

Commit 1df2540

Browse files
authored
Merge pull request #612 from solid-connection/feat/application-status-access-funnel
✨ 지원자 현황 접근 상태별 퍼널 개선
2 parents 97f1cb0 + 69f7076 commit 1df2540

20 files changed

Lines changed: 869 additions & 406 deletions

‎apps/web/src/apis/Scores/getGpaList.ts‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
import { useQuery } from "@tanstack/react-query";
1+
import { type UseQueryOptions, useQuery } from "@tanstack/react-query";
2+
import type { AxiosResponse } from "axios";
23

3-
import { ScoresQueryKeys, scoresApi } from "./api";
4+
import { ScoresQueryKeys, scoresApi, type UseMyGpaScoreResponse } from "./api";
5+
6+
type UseGetMyGpaScoreOptions = Omit<
7+
UseQueryOptions<AxiosResponse<UseMyGpaScoreResponse>, unknown, UseMyGpaScoreResponse>,
8+
"queryKey" | "queryFn"
9+
>;
410

511
/**
612
* @description 내 학점 점수 조회 훅
713
*/
8-
const useGetMyGpaScore = ({ enabled = true }: { enabled?: boolean } = {}) => {
14+
const useGetMyGpaScore = (props?: UseGetMyGpaScoreOptions) => {
915
return useQuery({
1016
queryKey: [ScoresQueryKeys.myGpaScore],
1117
queryFn: scoresApi.getMyGpaScore,
12-
enabled,
18+
enabled: true,
1319
staleTime: Infinity,
1420
select: (data) => data.data,
21+
...props,
1522
});
1623
};
1724

‎apps/web/src/apis/Scores/getLanguageTestList.ts‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1-
import { useQuery } from "@tanstack/react-query";
1+
import { type UseQueryOptions, useQuery } from "@tanstack/react-query";
2+
import type { AxiosResponse } from "axios";
23

3-
import { ScoresQueryKeys, scoresApi } from "./api";
4+
import type { LanguageTestScore } from "@/types/score";
5+
import { ScoresQueryKeys, scoresApi, type UseGetMyLanguageTestScoreResponse } from "./api";
6+
7+
type UseGetMyLanguageTestScoreOptions = Omit<
8+
UseQueryOptions<AxiosResponse<UseGetMyLanguageTestScoreResponse>, unknown, LanguageTestScore[]>,
9+
"queryKey" | "queryFn"
10+
>;
411

512
/**
613
* @description 내 어학 점수 조회 훅
714
*/
8-
const useGetMyLanguageTestScore = () => {
15+
const useGetMyLanguageTestScore = (props?: UseGetMyLanguageTestScoreOptions) => {
916
return useQuery({
1017
queryKey: [ScoresQueryKeys.myLanguageTestScore],
1118
queryFn: scoresApi.getMyLanguageTestScore,
19+
enabled: true,
1220
staleTime: Infinity,
1321
select: (data) => data.data.languageTestScoreStatusResponseList,
22+
...props,
1423
});
1524
};
1625

‎apps/web/src/apis/applications/api.ts‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
import type { AxiosResponse } from "axios";
2-
import type { ApplicationListResponse } from "@/types/application";
2+
import type { ApplicationListResponse, ApplicationPreviewResponse } from "@/types/application";
33
import { axiosInstance } from "@/utils/axiosInstance";
44

55
// ====== Query Keys ======
66
export const ApplicationsQueryKeys = {
77
competitorsApplicationList: "competitorsApplicationList",
8+
applicationPreview: "applicationPreview",
89
} as const;
910

1011
// ====== Types ======
1112
export interface UseSubmitApplicationResponse {
12-
isSuccess: boolean;
13+
totalApplyCount: number;
14+
applyCount: number;
15+
appliedUniversities: {
16+
choices: string[];
17+
};
1318
}
1419

1520
export interface UseSubmitApplicationRequest {
@@ -37,6 +42,13 @@ export const applicationsApi = {
3742
return axiosInstance.get("/applications");
3843
},
3944

45+
/**
46+
* 지원자가 있는 대학의 제한 공개 정보 조회
47+
*/
48+
getApplicationPreview: async (): Promise<AxiosResponse<ApplicationPreviewResponse>> => {
49+
return axiosInstance.get("/applications/preview");
50+
},
51+
4052
/**
4153
* 지원 제출
4254
*/
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { useQuery } from "@tanstack/react-query";
2+
import type { AxiosError } from "axios";
3+
import type { ApplicationPreviewResponse } from "@/types/application";
4+
import { ApplicationsQueryKeys, applicationsApi } from "./api";
5+
6+
const useGetApplicationPreview = () => {
7+
return useQuery<ApplicationPreviewResponse, AxiosError<{ message: string }>>({
8+
queryKey: [ApplicationsQueryKeys.applicationPreview],
9+
queryFn: async () => {
10+
const response = await applicationsApi.getApplicationPreview();
11+
return response.data;
12+
},
13+
staleTime: 1000 * 60 * 5,
14+
});
15+
};
16+
17+
export default useGetApplicationPreview;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export type { UseSubmitApplicationRequest, UseSubmitApplicationResponse } from "./api";
22
export { ApplicationsQueryKeys, applicationsApi } from "./api";
33
export { default as useGetApplicationsList } from "./getApplicants";
4+
export { default as useGetApplicationPreview } from "./getApplicationPreview";
45
export { default as useGetCompetitors } from "./getCompetitors";
56
export { default as usePostSubmitApplication } from "./postSubmitApplication";

‎apps/web/src/app/my/school-email/_lib/returnTo.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export const SCHOOL_EMAIL_RETURN_PATHS = {
22
applicationApply: "/university/application/apply",
3+
applicationStatus: "/university/application",
34
score: "/university/score",
45
gpaSubmit: "/university/score/submit/gpa",
56
} as const;

0 commit comments

Comments
 (0)