[as] feat: dc service 추가

This commit is contained in:
2026-07-29 15:39:37 +09:00
parent afbebb9dfc
commit b8b0b24b0e
6 changed files with 120 additions and 3 deletions
+19
View File
@@ -0,0 +1,19 @@
import { client } from "@/shared/api";
import { ENDPOINT } from "@/shared/config";
import type {
NowDmgMtncGnsvyResponseDto,
NowDmgMtncGnsvySearchDto,
} from "../model/dc-interface";
async function getNowDmgMtncGnsvy(
params: NowDmgMtncGnsvySearchDto,
): Promise<NowDmgMtncGnsvyResponseDto[]> {
const response = await client.get<NowDmgMtncGnsvyResponseDto[]>(
ENDPOINT.DC_SERVICE.NOW_DMG_MTNC_GNSVY,
{ params },
);
return response.data;
}
export { getNowDmgMtncGnsvy };
+17
View File
@@ -0,0 +1,17 @@
import { useQuery } from "@tanstack/react-query";
import { ENDPOINT } from "@/shared/config";
import type { NowDmgMtncGnsvySearchDto } from "../model/dc-interface";
import { getNowDmgMtncGnsvy } from "./dc-service";
export const nowDmgMtncGnsvyBaseKey = [ENDPOINT.DC_SERVICE.NOW_DMG_MTNC_GNSVY] as const;
export function useNowDmgMtncGnsvy(params: NowDmgMtncGnsvySearchDto) {
return useQuery({
queryKey: [...nowDmgMtncGnsvyBaseKey, params],
queryFn: () => getNowDmgMtncGnsvy(params),
enabled: Boolean(params.swtrmtFcltCd && params.ctpvNm),
});
}