Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
730 changes: 730 additions & 0 deletions apps/web/src/apis/.bruno-cache/hashes.json

Large diffs are not rendered by default.

90 changes: 74 additions & 16 deletions apps/web/src/apis/Admin/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
import { axiosInstance } from "@/utils/axiosInstance";

export type RejectMentorApplicationResponse = void;

export type RejectMentorApplicationRequest = Record<string, never>;

export type MentorApplicationListResponse = void;

export type ApproveMentorApplicationResponse = void;

export type ApproveMentorApplicationRequest = Record<string, never>;

export type MappingMentorapplicationUniversityResponse = void;

export type MappingMentorapplicationUniversityRequest = Record<string, never>;

export type CountMentorApplicationByStatusResponse = void;

export type MentorApplicationHistoryListResponse = void;

export interface VerifyLanguageTestResponse {
id: number;
languageTestType: string;
Expand Down Expand Up @@ -143,34 +161,74 @@ export interface GpaListResponse {
}

export const adminApi = {
putVerifyLanguageTest: async (params: {
languageTestScoreId: string | number;
data?: VerifyLanguageTestRequest;
}): Promise<VerifyLanguageTestResponse> => {
postRejectMentorApplication: async (params: { mentorApplicationId: string | number, data?: RejectMentorApplicationRequest }): Promise<RejectMentorApplicationResponse> => {
const res = await axiosInstance.post<RejectMentorApplicationResponse>(
`/admin/mentor-applications/${params.mentorApplicationId}/reject`, params?.data
);
return res.data;
},

getMentorApplicationList: async (params: { params?: Record<string, any> }): Promise<MentorApplicationListResponse> => {
const res = await axiosInstance.get<MentorApplicationListResponse>(
`/admin/mentor-applications?page=2&size=10&mentorApplicationStatus=PENDING&nickname&createdAt=2025-11-14`, { params: params?.params }
);
return res.data;
},

postApproveMentorApplication: async (params: { mentorApplicationId: string | number, data?: ApproveMentorApplicationRequest }): Promise<ApproveMentorApplicationResponse> => {
const res = await axiosInstance.post<ApproveMentorApplicationResponse>(
`/admin/mentor-applications/${params.mentorApplicationId}/approve`, params?.data
);
return res.data;
},

postMappingMentorapplicationUniversity: async (params: { mentorApplicationId: string | number, data?: MappingMentorapplicationUniversityRequest }): Promise<MappingMentorapplicationUniversityResponse> => {
const res = await axiosInstance.post<MappingMentorapplicationUniversityResponse>(
`/admin/mentor-applications/${params.mentorApplicationId}/assign-university`, params?.data
);
return res.data;
},

getCountMentorApplicationByStatus: async (params: { params?: Record<string, any> }): Promise<CountMentorApplicationByStatusResponse> => {
const res = await axiosInstance.get<CountMentorApplicationByStatusResponse>(
`/admin/mentor-applications/count`, { params: params?.params }
);
return res.data;
},

getMentorApplicationHistoryList: async (params: { site_user_id: string | number, params?: Record<string, any> }): Promise<MentorApplicationHistoryListResponse> => {
const res = await axiosInstance.get<MentorApplicationHistoryListResponse>(
`/admin/mentor-applications/${params.site_user_id}/history`, { params: params?.params }
);
return res.data;
},

putVerifyLanguageTest: async (params: { languageTestScoreId: string | number, data?: VerifyLanguageTestRequest }): Promise<VerifyLanguageTestResponse> => {
const res = await axiosInstance.put<VerifyLanguageTestResponse>(
`/admin/scores/language-tests/${params.languageTestScoreId}`,
params?.data,
`/admin/scores/language-tests/${params.languageTestScoreId}`, params?.data
);
return res.data;
},

getLanguageTestList: async (params: { params?: Record<string, any> }): Promise<LanguageTestListResponse> => {
const res = await axiosInstance.get<LanguageTestListResponse>(`/admin/scores/language-tests?page=1&size=10`, {
params: params?.params,
});
const res = await axiosInstance.get<LanguageTestListResponse>(
`/admin/scores/language-tests?page=1&size=10`, { params: params?.params }
);
return res.data;
},

putVerifyGpa: async (params: {
gpaScoreId: string | number;
data?: VerifyGpaRequest;
}): Promise<VerifyGpaResponse> => {
const res = await axiosInstance.put<VerifyGpaResponse>(`/admin/scores/gpas/${params.gpaScoreId}`, params?.data);
putVerifyGpa: async (params: { gpaScoreId: string | number, data?: VerifyGpaRequest }): Promise<VerifyGpaResponse> => {
const res = await axiosInstance.put<VerifyGpaResponse>(
`/admin/scores/gpas/${params.gpaScoreId}`, params?.data
);
return res.data;
},

getGpaList: async (params: { params?: Record<string, any> }): Promise<GpaListResponse> => {
const res = await axiosInstance.get<GpaListResponse>(`/admin/scores/gpas`, { params: params?.params });
const res = await axiosInstance.get<GpaListResponse>(
`/admin/scores/gpas`, { params: params?.params }
);
return res.data;
},
};

};
13 changes: 13 additions & 0 deletions apps/web/src/apis/Admin/getCountMentorApplicationByStatus.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { AxiosError } from "axios";
import { useQuery } from "@tanstack/react-query";
import { adminApi, CountMentorApplicationByStatusResponse } from "./api";
import { QueryKeys } from "../queryKeys";

const useGetCountMentorApplicationByStatus = (params?: Record<string, any>) => {
return useQuery<CountMentorApplicationByStatusResponse, AxiosError>({
queryKey: [QueryKeys.Admin.countMentorApplicationByStatus, params],
queryFn: () => adminApi.getCountMentorApplicationByStatus(params ? { params } : {}),
});
};

export default useGetCountMentorApplicationByStatus;
6 changes: 3 additions & 3 deletions apps/web/src/apis/Admin/getGpaList.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AxiosError } from "axios";
import { useQuery } from "@tanstack/react-query";
import type { AxiosError } from "axios";
import { adminApi, GpaListResponse } from "./api";
import { QueryKeys } from "../queryKeys";
import { adminApi, type GpaListResponse } from "./api";

const useGetGpaList = (params?: Record<string, any>) => {
return useQuery<GpaListResponse, AxiosError>({
Expand All @@ -10,4 +10,4 @@ const useGetGpaList = (params?: Record<string, any>) => {
});
};

export default useGetGpaList;
export default useGetGpaList;
6 changes: 3 additions & 3 deletions apps/web/src/apis/Admin/getLanguageTestList.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AxiosError } from "axios";
import { useQuery } from "@tanstack/react-query";
import type { AxiosError } from "axios";
import { adminApi, LanguageTestListResponse } from "./api";
import { QueryKeys } from "../queryKeys";
import { adminApi, type LanguageTestListResponse } from "./api";

const useGetLanguageTestList = (params?: Record<string, any>) => {
return useQuery<LanguageTestListResponse, AxiosError>({
Expand All @@ -10,4 +10,4 @@ const useGetLanguageTestList = (params?: Record<string, any>) => {
});
};

export default useGetLanguageTestList;
export default useGetLanguageTestList;
14 changes: 14 additions & 0 deletions apps/web/src/apis/Admin/getMentorApplicationHistoryList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { AxiosError } from "axios";
import { useQuery } from "@tanstack/react-query";
import { adminApi, MentorApplicationHistoryListResponse } from "./api";
import { QueryKeys } from "../queryKeys";

const useGetMentorApplicationHistoryList = (site_user_id: string | number, params?: Record<string, any>) => {
return useQuery<MentorApplicationHistoryListResponse, AxiosError>({
queryKey: [QueryKeys.Admin.mentorApplicationHistoryList, site_user_id, params],
queryFn: () => adminApi.getMentorApplicationHistoryList({ site_user_id, params }),
enabled: !!site_user_id,
});
};

export default useGetMentorApplicationHistoryList;
13 changes: 13 additions & 0 deletions apps/web/src/apis/Admin/getMentorApplicationList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { AxiosError } from "axios";
import { useQuery } from "@tanstack/react-query";
import { adminApi, MentorApplicationListResponse } from "./api";
import { QueryKeys } from "../queryKeys";

const useGetMentorApplicationList = (params?: Record<string, any>) => {
return useQuery<MentorApplicationListResponse, AxiosError>({
queryKey: [QueryKeys.Admin.mentorApplicationList, params],
queryFn: () => adminApi.getMentorApplicationList(params ? { params } : {}),
});
};

export default useGetMentorApplicationList;
16 changes: 11 additions & 5 deletions apps/web/src/apis/Admin/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
export { adminApi } from "./api";
export { default as getGpaList } from "./getGpaList";
export { default as getLanguageTestList } from "./getLanguageTestList";
export { default as putVerifyGpa } from "./putVerifyGpa";
export { default as putVerifyLanguageTest } from "./putVerifyLanguageTest";
export { adminApi } from './api';
export { default as getCountMentorApplicationByStatus } from './getCountMentorApplicationByStatus';
export { default as getGpaList } from './getGpaList';
export { default as getLanguageTestList } from './getLanguageTestList';
export { default as getMentorApplicationHistoryList } from './getMentorApplicationHistoryList';
export { default as getMentorApplicationList } from './getMentorApplicationList';
export { default as postApproveMentorApplication } from './postApproveMentorApplication';
export { default as postMappingMentorapplicationUniversity } from './postMappingMentorapplicationUniversity';
export { default as postRejectMentorApplication } from './postRejectMentorApplication';
export { default as putVerifyGpa } from './putVerifyGpa';
export { default as putVerifyLanguageTest } from './putVerifyLanguageTest';
11 changes: 11 additions & 0 deletions apps/web/src/apis/Admin/postApproveMentorApplication.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { AxiosError } from "axios";
import { useMutation } from "@tanstack/react-query";
import { adminApi, ApproveMentorApplicationResponse, ApproveMentorApplicationRequest } from "./api";

const usePostApproveMentorApplication = () => {
return useMutation<ApproveMentorApplicationResponse, AxiosError, { mentorApplicationId: string | number; data: ApproveMentorApplicationRequest }>({
mutationFn: (variables) => adminApi.postApproveMentorApplication(variables),
});
};

export default usePostApproveMentorApplication;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { AxiosError } from "axios";
import { useMutation } from "@tanstack/react-query";
import { adminApi, MappingMentorapplicationUniversityResponse, MappingMentorapplicationUniversityRequest } from "./api";

const usePostMappingMentorapplicationUniversity = () => {
return useMutation<MappingMentorapplicationUniversityResponse, AxiosError, { mentorApplicationId: string | number; data: MappingMentorapplicationUniversityRequest }>({
mutationFn: (variables) => adminApi.postMappingMentorapplicationUniversity(variables),
});
};

export default usePostMappingMentorapplicationUniversity;
11 changes: 11 additions & 0 deletions apps/web/src/apis/Admin/postRejectMentorApplication.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { AxiosError } from "axios";
import { useMutation } from "@tanstack/react-query";
import { adminApi, RejectMentorApplicationResponse, RejectMentorApplicationRequest } from "./api";

const usePostRejectMentorApplication = () => {
return useMutation<RejectMentorApplicationResponse, AxiosError, { mentorApplicationId: string | number; data: RejectMentorApplicationRequest }>({
mutationFn: (variables) => adminApi.postRejectMentorApplication(variables),
});
};

export default usePostRejectMentorApplication;
6 changes: 3 additions & 3 deletions apps/web/src/apis/Admin/putVerifyGpa.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { AxiosError } from "axios";
import { useMutation } from "@tanstack/react-query";
import type { AxiosError } from "axios";
import { adminApi, type VerifyGpaRequest, type VerifyGpaResponse } from "./api";
import { adminApi, VerifyGpaResponse, VerifyGpaRequest } from "./api";

const usePutVerifyGpa = () => {
return useMutation<VerifyGpaResponse, AxiosError, { gpaScoreId: string | number; data: VerifyGpaRequest }>({
mutationFn: (variables) => adminApi.putVerifyGpa(variables),
});
};

export default usePutVerifyGpa;
export default usePutVerifyGpa;
12 changes: 4 additions & 8 deletions apps/web/src/apis/Admin/putVerifyLanguageTest.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { AxiosError } from "axios";
import { useMutation } from "@tanstack/react-query";
import type { AxiosError } from "axios";
import { adminApi, type VerifyLanguageTestRequest, type VerifyLanguageTestResponse } from "./api";
import { adminApi, VerifyLanguageTestResponse, VerifyLanguageTestRequest } from "./api";

const usePutVerifyLanguageTest = () => {
return useMutation<
VerifyLanguageTestResponse,
AxiosError,
{ languageTestScoreId: string | number; data: VerifyLanguageTestRequest }
>({
return useMutation<VerifyLanguageTestResponse, AxiosError, { languageTestScoreId: string | number; data: VerifyLanguageTestRequest }>({
mutationFn: (variables) => adminApi.putVerifyLanguageTest(variables),
});
};

export default usePutVerifyLanguageTest;
export default usePutVerifyLanguageTest;
Loading
Loading