refactor: Update category value handling to make menuObjid optional

- Modified the addCategoryValue function to allow menuObjid to be optional, accommodating scenarios where it may not be provided, such as in global management screens.
- Adjusted related service and controller logic to handle the absence of menuObjid gracefully, ensuring that the application remains robust and user-friendly.
- Enhanced the frontend components to reflect these changes, improving the overall user experience when adding category values across multiple companies.
This commit is contained in:
kjs
2026-04-10 14:17:35 +09:00
parent 5842a91c7f
commit b8860e56e5
5 changed files with 47 additions and 53 deletions

View File

@@ -116,12 +116,7 @@ export const addCategoryValue = async (req: AuthenticatedRequest, res: Response)
const userId = req.user!.userId;
const { menuObjid, ...value } = req.body;
if (!menuObjid) {
return res.status(400).json({
success: false,
message: "menuObjid는 필수입니다",
});
}
// menuObjid는 선택사항 — 옵션설정 등 전역 관리 화면에서는 없을 수 있음
logger.info("카테고리 값 추가 요청", {
tableName: value.tableName,
@@ -134,7 +129,7 @@ export const addCategoryValue = async (req: AuthenticatedRequest, res: Response)
value,
companyCode,
userId,
Number(menuObjid) // ← menuObjid 전달
menuObjid ? Number(menuObjid) : null
);
return res.status(201).json({