diff --git a/apps/cs/src/entities/code/api/lwpocode-service.ts b/apps/cs/src/entities/code/api/lwpocode-service.ts index b8f11fa22..818ddb120 100644 --- a/apps/cs/src/entities/code/api/lwpocode-service.ts +++ b/apps/cs/src/entities/code/api/lwpocode-service.ts @@ -62,6 +62,12 @@ export class LwpoCodeApiService implements LwpoCodeService { `${ENDPOINT.CMS_SERVICE.LWPO_CODE}/${lwpoCd}/up-cd/${upCd}`, ); } + + public async codeRefreshAll(): Promise { + await client.post( + `${ENDPOINT.CMS_SERVICE.LWPO_CODE}/cache/refresh-all`, + ); + } } export const LwpoCodeApi = new LwpoCodeApiService(); diff --git a/apps/cs/src/entities/code/model/lwpocode-interface.ts b/apps/cs/src/entities/code/model/lwpocode-interface.ts index 785d86e1e..2538c1c30 100644 --- a/apps/cs/src/entities/code/model/lwpocode-interface.ts +++ b/apps/cs/src/entities/code/model/lwpocode-interface.ts @@ -65,4 +65,5 @@ export interface LwpoCodeService { lwpoCd: string, data: LwpoCodeFormData, ): Promise; + codeRefreshAll(): Promise; } diff --git a/apps/cs/src/pages/code/ui/lwpocode-section.tsx b/apps/cs/src/pages/code/ui/lwpocode-section.tsx index 2d90e99a2..78a51fae5 100644 --- a/apps/cs/src/pages/code/ui/lwpocode-section.tsx +++ b/apps/cs/src/pages/code/ui/lwpocode-section.tsx @@ -7,6 +7,7 @@ import { ENDPOINT } from "@/shared/config"; import { useDataTable } from "@/shared/lib"; import { columns } from "../model/lwpocode-table-columns"; import { LwpoCodeManagementDialog } from "./lwpocode-dialog"; +import { useMutation } from '@tanstack/react-query' type LwpoCodeSectionProps = { upCd?: string; @@ -58,6 +59,20 @@ function LwpoCodeSection({ upCd }: LwpoCodeSectionProps) { setPagination({ ...pagination, pageIndex: 0 }); }, [upCd]); + const { mutateAsync: codeRefreshAll } = useMutation({ + mutationFn: () => LwpoCodeApi.codeRefreshAll(), + onSuccess: () => { + alert('저장되었습니다.') + }, + onError: (error) => { + console.error('에러 발생:', error) + alert('에러가 발생했습니다.') + }, + }) + + + + return (
@@ -83,12 +98,17 @@ function LwpoCodeSection({ upCd }: LwpoCodeSectionProps) {

하위코드 목록

+ + +
{tableComponent}