Skip to content

Commit

Permalink
Merge pull request #69 from EdwinBetanc0urt/feature/add-name-on-menu-…
Browse files Browse the repository at this point in the history
…tree

feat: Add name on Menu Tree.
  • Loading branch information
yamelsenih authored Dec 5, 2024
2 parents 7868ab0 + be68b95 commit 01d7583
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/models/menu_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub struct MenuTree {
pub uuid: Option<String>,
pub id: Option<String>,
pub internal_id: Option<i32>,
pub name: Option<String>,
pub node_id: Option<i32>,
pub parent_id: Option<i32>,
pub sequence: Option<i32>,
Expand All @@ -53,6 +54,7 @@ impl Default for MenuTree {
uuid: None,
id: None,
internal_id: None,
name: None,
node_id: None,
parent_id: None,
sequence: None,
Expand Down Expand Up @@ -153,7 +155,7 @@ pub async fn menu_tree_from_id(_id: Option<String>, _dictionary_code: Option<&St
log::info!("Finded Menu Tree Value: {:?}", menu.id);
// sort menu children nodes by sequence
if let Some(ref mut children) = menu.children {
children.sort_by_key(|child| child.sequence.clone().unwrap_or(0));
children.sort_by_key(|child: &MenuTree| child.sequence.clone().unwrap_or(0));
}
Ok(menu)
},
Expand Down

0 comments on commit 01d7583

Please sign in to comment.