Skip to content

Commit

Permalink
LPD-37449 Pass layoutDataItems as param instead of layoutData
Browse files Browse the repository at this point in the history
  • Loading branch information
veroglez authored and brianchandotcom committed Sep 29, 2024
1 parent bbb8002 commit dbbd7f7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ const PARENT_TYPES = [
LAYOUT_DATA_ITEM_TYPES.root,
];

function getItemTargetToPaste(item, layoutData) {
function getItemTargetToPaste(item, layoutDataItems) {
if (PARENT_TYPES.some((type) => type === item.type)) {
return item;
}

const parent = layoutData?.items?.[item.parentId];
const parent = layoutDataItems[item.parentId];

return getItemTargetToPaste(parent, layoutData);
return getItemTargetToPaste(parent, layoutDataItems);
}

export default function canBeCopied(
Expand All @@ -47,7 +47,7 @@ export default function canBeCopied(
fragmentEntryLinks
);

const parent = getItemTargetToPaste(target, layoutData);
const parent = getItemTargetToPaste(target, layoutData.items);

const isChildAllowed = checkAllowedChild(
source,
Expand Down

0 comments on commit dbbd7f7

Please sign in to comment.