From 148f20c7c53c7350f733be3e2e00be5a88703f7a Mon Sep 17 00:00:00 2001 From: kjs Date: Thu, 2 Apr 2026 17:42:45 +0900 Subject: [PATCH] Update menu assignment logic and enhance dynamic search filter rendering - Modified the menu assignment logic to ensure that screen assignments are only deactivated if the menu URL is either empty or not a valid screen URL, improving the accuracy of screen management. - Updated the rendering of active filters in the DynamicSearchFilter component to include a key for each filter, enhancing React's rendering performance and preventing potential issues with list updates. These changes improve the functionality and performance of the admin interface, ensuring a more reliable user experience. --- backend-node/src/controllers/adminController.ts | 7 ++++--- frontend/components/common/DynamicSearchFilter.tsx | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend-node/src/controllers/adminController.ts b/backend-node/src/controllers/adminController.ts index 7af6b403..2b04b8e7 100644 --- a/backend-node/src/controllers/adminController.ts +++ b/backend-node/src/controllers/adminController.ts @@ -1405,10 +1405,11 @@ export async function updateMenu( ] ); - // menu_url이 비어있으면 화면 할당도 해제 (screen_menu_assignments의 is_active를 'N'으로) - if (!menuUrl) { + // menu_url이 비어있거나 화면관리 URL이 아니면 화면 할당 해제 + const isScreenUrl = menuUrl && (menuUrl.startsWith("/screens/") || menuUrl.startsWith("/screen/")); + if (!menuUrl || !isScreenUrl) { await query( - `UPDATE screen_menu_assignments + `UPDATE screen_menu_assignments SET is_active = 'N' WHERE menu_objid = $1 AND company_code = $2`, [Number(menuId), companyCode] diff --git a/frontend/components/common/DynamicSearchFilter.tsx b/frontend/components/common/DynamicSearchFilter.tsx index 1a0f8acd..cfd3e709 100644 --- a/frontend/components/common/DynamicSearchFilter.tsx +++ b/frontend/components/common/DynamicSearchFilter.tsx @@ -432,7 +432,7 @@ export function DynamicSearchFilter({ {/* 활성 필터들 — 라벨 없이 placeholder만 */} {activeFilters.length > 0 ? (
- {activeFilters.map((filter) => renderFilterInput(filter))} + {activeFilters.map((filter) =>
{renderFilterInput(filter)}
)}