Skip to content

Commit

Permalink
Fix deleting sub menus (#16990)
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco authored Nov 11, 2024
1 parent 8ff1695 commit f262314
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,9 @@ public async Task<IActionResult> Delete(string menuContentItemId, string menuIte
return NotFound();
}

var menuItems = menuContentAsJson[nameof(MenuItemsListPart)]?[nameof(MenuItemsListPart.MenuItems)] as JsonArray;
menuItems?.Remove(menuItem);
var menuItems = menuContentAsJson.SelectNode(menuItem.Parent.GetPath()) as JsonArray;

menuItems.Remove(menuItem);

await _contentManager.SaveDraftAsync(menu);

Expand Down

0 comments on commit f262314

Please sign in to comment.