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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user