33 lines
889 B
TypeScript
33 lines
889 B
TypeScript
import { client } from "@/shared/api";
|
|
import { ENDPOINT } from "@/shared/config";
|
|
|
|
import type {
|
|
DashboardMainResponseDto,
|
|
DashboardMainSearchDto,
|
|
DashboardService,
|
|
InPrgrsDocPicResponseDto,
|
|
} from "../model/dashboard-interface";
|
|
|
|
const BASE = ENDPOINT.AS_SERVICE.DASHBOARD;
|
|
|
|
async function getMainDashboard(
|
|
searchDto: DashboardMainSearchDto,
|
|
): Promise<DashboardMainResponseDto> {
|
|
const response = await client.get<DashboardMainResponseDto>(`${BASE}/main`, {
|
|
params: searchDto,
|
|
});
|
|
return response.data;
|
|
}
|
|
|
|
async function getInPrgrsDocPicList(searchYear?: number): Promise<InPrgrsDocPicResponseDto[]> {
|
|
const response = await client.get<InPrgrsDocPicResponseDto[]>(`${BASE}/in-progress-docs`, {
|
|
params: { searchYear },
|
|
});
|
|
return response.data;
|
|
}
|
|
|
|
export const dashboardService = {
|
|
getMainDashboard,
|
|
getInPrgrsDocPicList,
|
|
} satisfies DashboardService;
|