Skip to content

fix: Content: SEO Tab - Select Page Parent Dropdown is showing the same route multiple times #2541

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

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ export const ItemParent = connect((state) => {
setParents(
parentOptions(props.currentItemLangID, props.path, {
...items,
...res?.data,
// needs to reduce and converts this data as the same format of the items to
// prevent having an issue on having an itemZUID with an incorrect format
// the reason is that the item has a format of {[itemZUID]:data}
// while the res.data has a value of an array which cause the needs of converting
// the response to an object with a zuid as a key
...res?.data.reduce((acc, curr) => {
return { ...acc, [curr.meta.ZUID]: curr };
}, {}),
})
);
});
Expand Down Expand Up @@ -107,6 +114,7 @@ export const ItemParent = connect((state) => {
* or a performance issue. To work around this we maintain the `parents` state internal and add the new parent we load from the
* API to allow it to be pre-selected while avoiding re-renders on changes to this item.
*/

setParents(
parentOptions(props.currentItemLangID, props.path, {
...items,
Expand Down