From 70832bae82bd4267b3c40596c22ec5fb6a7071dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A7=80=EC=B2=A0?= Date: Thu, 26 Jun 2025 17:48:04 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BD=94=EB=93=9C=EA=B0=B1=EC=8B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/entities/code/api/lwpocode-service.ts | 6 ++++++ .../entities/code/model/lwpocode-interface.ts | 1 + .../cs/src/pages/code/ui/lwpocode-section.tsx | 20 +++++++++++++++++++ 3 files changed, 27 insertions(+) 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}