-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix many to many (React) #13200
Fix many to many (React) #13200
Conversation
} | ||
return []; | ||
}; | ||
export const mapIdList = (idList: ReadonlyArray<any>) => idList.filter((entityId: any) => entityId !== '').map((entityId: any) => ({ id: entityId })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and when the idList is undefined ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, looks like a better fix to me. That list should not be undefined. It also fixes the issue with the previously saved options being displayed as selected.
Fix the root issue of #13182
And fix an underlying issue where the relations from a many-to-many are set from the previous save.
the
value
fromAvInput
should be set once.This same "solution" is already applied with:
AvForm model={isNew ? {} : fooEntity}