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:
@@ -80,7 +80,7 @@ export async function getCategoryValues(
|
||||
*/
|
||||
export async function addCategoryValue(
|
||||
value: TableCategoryValue,
|
||||
menuObjid: number
|
||||
menuObjid?: number
|
||||
) {
|
||||
try {
|
||||
const response = await apiClient.post<{
|
||||
@@ -88,7 +88,7 @@ export async function addCategoryValue(
|
||||
data: TableCategoryValue;
|
||||
}>("/table-categories/values", {
|
||||
...value,
|
||||
menuObjid, // ← menuObjid 포함
|
||||
menuObjid: menuObjid || undefined,
|
||||
});
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
|
||||
Reference in New Issue
Block a user