fix(design-system): molecules/editor-category: handleRoleListUpdate should not be nested function

This commit is contained in:
41666 2022-01-22 18:13:00 -05:00
parent dac2af43a2
commit cba0d1f35a

View file

@ -21,10 +21,11 @@ export type CategoryProps = {
export const EditorCategory = (props: CategoryProps) => {
const updateValue = <T extends keyof CategoryT>(key: T, value: CategoryT[T]) => {
console.log('update value', { key, value, category: props.category });
props.onChange({ ...props.category, [key]: value });
};
const handleRoleListUpdate = (roles: RoleT['id'][]) => () => {
const handleRoleListUpdate = (roles: RoleT['id'][]) => {
updateValue('roles', roles);
};