diff --git a/apps/catalog-admin/components/codes-editor/codes-editor.module.css b/apps/catalog-admin/components/codes-editor/codes-editor.module.css index b82747e83..a24fb31fd 100644 --- a/apps/catalog-admin/components/codes-editor/codes-editor.module.css +++ b/apps/catalog-admin/components/codes-editor/codes-editor.module.css @@ -7,6 +7,7 @@ .codeTree { border-radius: 5px; flex-basis: 50%; + height: 506px; } .node { diff --git a/apps/catalog-admin/components/codes-editor/index.tsx b/apps/catalog-admin/components/codes-editor/index.tsx index 0e374633d..de261ea3d 100644 --- a/apps/catalog-admin/components/codes-editor/index.tsx +++ b/apps/catalog-admin/components/codes-editor/index.tsx @@ -59,9 +59,10 @@ export const CodesEditor = ({ codeList: dbCodeList }: Props) => { }; const updateCodeParent = (value: string) => { + const convertedValue = value !== null ? +value : null; setSelectedCode((prevSelectedCode) => ({ ...prevSelectedCode, - parentID: +value, + parentID: convertedValue, })); }; @@ -203,15 +204,16 @@ export const CodesEditor = ({ codeList: dbCodeList }: Props) => { .map((code: Code) => ({ label: String(getTranslateText(code.name)), value: code.id.toString(), - })); + })) + .concat({ label: localization.catalogAdmin.noParentCode, value: null }); } return ( <>