mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 11:29:12 +00:00
fix(design-system): molecules/editor-category: handleRoleListUpdate should not be nested function
This commit is contained in:
parent
dac2af43a2
commit
cba0d1f35a
1 changed files with 2 additions and 1 deletions
|
@ -21,10 +21,11 @@ export type CategoryProps = {
|
||||||
|
|
||||||
export const EditorCategory = (props: CategoryProps) => {
|
export const EditorCategory = (props: CategoryProps) => {
|
||||||
const updateValue = <T extends keyof CategoryT>(key: T, value: CategoryT[T]) => {
|
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 });
|
props.onChange({ ...props.category, [key]: value });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRoleListUpdate = (roles: RoleT['id'][]) => () => {
|
const handleRoleListUpdate = (roles: RoleT['id'][]) => {
|
||||||
updateValue('roles', roles);
|
updateValue('roles', roles);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue