From 47cbdf5fa9ff87def6fcc94dc4e45453d1d0f76e Mon Sep 17 00:00:00 2001 From: bicochan Date: Fri, 27 Jun 2025 10:31:13 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EC=BD=94=EB=93=9C=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=EA=B0=B1=EC=8B=A0=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=B0=8F=20W3=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cs/src/pages/code/ui/lwpocode-section.tsx | 49 ++++++++----------- .../common/components/src/ui/header/index.tsx | 3 -- 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/apps/cs/src/pages/code/ui/lwpocode-section.tsx b/apps/cs/src/pages/code/ui/lwpocode-section.tsx index 78a51fae5..b1713fa0f 100644 --- a/apps/cs/src/pages/code/ui/lwpocode-section.tsx +++ b/apps/cs/src/pages/code/ui/lwpocode-section.tsx @@ -1,19 +1,19 @@ import { useEffect, useState } from "react"; -import { keepPreviousData, useQuery } from "@tanstack/react-query"; +import { keepPreviousData, useMutation, useQuery } from "@tanstack/react-query"; import { getCoreRowModel, type PaginationState } from "@tanstack/react-table"; import { Button, Input, Label } from "@common/components"; import { LwpoCodeApi, type LwpoCodeParams } from "@/entities/code"; import { ENDPOINT } from "@/shared/config"; -import { useDataTable } from "@/shared/lib"; +import { useAlertStore, 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; }; function LwpoCodeSection({ upCd }: LwpoCodeSectionProps) { + const alert = useAlertStore((state) => state.setMessage); const [dialogOpen, setDialogOpen] = useState(false); const [lwpoCodeQuery, setLwpoCodeQuery] = useState({ lwpoCdNm: "", @@ -36,6 +36,13 @@ function LwpoCodeSection({ upCd }: LwpoCodeSectionProps) { placeholderData: keepPreviousData, }); + const { mutateAsync: codeRefreshAll } = useMutation({ + mutationFn: LwpoCodeApi.codeRefreshAll, + onSuccess: () => { + alert("코드 갱신이 완료되었습니다."); + }, + }); + const { tableComponent } = useDataTable({ query, tableOptions: { @@ -59,20 +66,6 @@ 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 (
@@ -98,17 +91,17 @@ function LwpoCodeSection({ upCd }: LwpoCodeSectionProps) {

하위코드 목록

- - - - - - +
+ + + + +
{tableComponent} diff --git a/packages/common/components/src/ui/header/index.tsx b/packages/common/components/src/ui/header/index.tsx index 8457b28dd..84c27f1c4 100644 --- a/packages/common/components/src/ui/header/index.tsx +++ b/packages/common/components/src/ui/header/index.tsx @@ -94,9 +94,6 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) {
-
- -

logo