Skip to content
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

Menu item #1003

Closed
wants to merge 5 commits into from
Closed

Conversation

sarahelsaig
Copy link

hishamco and others added 5 commits March 14, 2024 21:21
@@ -270,7 +271,7 @@ public async Task<IActionResult> Delete(string menuContentItemId, string menuIte
return NotFound();
}

var menuContentAsJson = (JsonObject)menu.Content;
var menuContentAsJson = (JsonDynamicObject)menu.Content;
// Look for the target menu item in the hierarchy.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not need , see :

public static implicit operator JsonObject(JsonDynamicObject value) => value._jsonObject;
public static implicit operator JsonDynamicObject(JsonObject value) => new(value);

@@ -280,8 +281,9 @@ public async Task<IActionResult> Delete(string menuContentItemId, string menuIte
return NotFound();
}

var menuItems = menuContentAsJson[nameof(MenuItemsListPart)]["MenuItems"] as JsonArray;
menuItems.Remove(menuItem);
var menuItemsListPart = menuContentAsJson[nameof(MenuItemsListPart)] as JsonDynamicObject;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the original code
We add Remove and other functions just to keep untransformed code like menu.Content.Remove working

@sarahelsaig
Copy link
Author

No longer applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants