[as] feat: 결재선 관리 페이지 구현

This commit is contained in:
2026-05-18 17:40:21 +09:00
parent 0e067bb5fc
commit 25affc06b9
43 changed files with 2071 additions and 236 deletions
@@ -0,0 +1,29 @@
import { client } from "@/shared/api/client";
import { ENDPOINT } from "@/shared/config";
import type { Code, CodeService } from "../model/code-interface";
async function getList(upCd: string): Promise<Code[]> {
const response = await client.get<Code[]>(`${ENDPOINT.CMS_SERVICE.CODE}/${upCd}`);
return response.data;
}
async function getListByUseYn(upCd: string, useYn: string): Promise<Code[]> {
const response = await client.get<Code[]>(
`${ENDPOINT.CMS_SERVICE.CODE}/${upCd}/${useYn}`,
);
return response.data;
}
async function getCodeName(upCd: string, lwpoCd: string): Promise<string> {
const response = await client.get<string>(
`${ENDPOINT.CMS_SERVICE.CODE}/${upCd}/lwpoCd/${lwpoCd}`,
);
return response.data;
}
export const codeService = {
getList,
getListByUseYn,
getCodeName,
} satisfies CodeService;
+36
View File
@@ -0,0 +1,36 @@
import { useQuery } from "@tanstack/react-query";
import { ENDPOINT } from "@/shared/config";
import { codeService } from "./code-service";
const codeBaseKey = [ENDPOINT.CMS_SERVICE.CODE] as const;
const CODE_STALE_TIME = 1000 * 60 * 10;
export function useCodeList(upCd: string | undefined) {
return useQuery({
queryKey: [...codeBaseKey, upCd],
queryFn: () => codeService.getList(upCd!),
enabled: Boolean(upCd),
staleTime: CODE_STALE_TIME,
});
}
export function useCodeListByUseYn(upCd: string | undefined, useYn: string) {
return useQuery({
queryKey: [...codeBaseKey, upCd, useYn],
queryFn: () => codeService.getListByUseYn(upCd!, useYn),
enabled: Boolean(upCd && useYn),
staleTime: CODE_STALE_TIME,
});
}
export function useCodeName(upCd: string | undefined, lwpoCd: string | undefined) {
return useQuery({
queryKey: [...codeBaseKey, upCd, "name", lwpoCd],
queryFn: () => codeService.getCodeName(upCd!, lwpoCd!),
enabled: Boolean(upCd && lwpoCd),
staleTime: CODE_STALE_TIME,
});
}