복사에러 수정 #309

Merged
kjs merged 2 commits from feature/screen-management into main 2025-12-22 09:53:54 +09:00
1 changed files with 13 additions and 4 deletions

View File

@ -2449,10 +2449,19 @@ export class MenuCopyService {
// menuIdMap에 없으면 원본 menu_objid가 복사된 메뉴 범위 밖이므로
// scope_type을 'table'로 변경하거나, 매핑이 없으면 null 처리
const finalMenuObjid = newMenuObjid !== undefined ? newMenuObjid : null;
const finalScopeType =
r.scope_type === "menu" && finalMenuObjid === null
? "table" // 메뉴 매핑이 없으면 table 스코프로 변경
: r.scope_type;
// scope_type 결정 로직:
// 1. menu 스코프인데 menu_objid 매핑이 없는 경우
// - table_name이 있으면 'table' 스코프로 변경
// - table_name이 없으면 'global' 스코프로 변경
// 2. 그 외에는 원본 scope_type 유지
let finalScopeType = r.scope_type;
if (r.scope_type === "menu" && finalMenuObjid === null) {
if (r.table_name) {
finalScopeType = "table"; // table_name이 있으면 table 스코프
} else {
finalScopeType = "global"; // table_name도 없으면 global 스코프
}
}
return [
r.newRuleId,