feat(modulo): sort search items
This commit is contained in:
parent
9b52a06a8b
commit
0cc52ccf63
|
@ -21,7 +21,7 @@ use crate::search::config::SearchConfig;
|
|||
use crate::sys::search::types;
|
||||
|
||||
pub fn generate(config: SearchConfig) -> types::Search {
|
||||
let items = config
|
||||
let mut items: Vec<types::SearchItem> = config
|
||||
.items
|
||||
.into_iter()
|
||||
.map(|item| types::SearchItem {
|
||||
|
@ -32,6 +32,8 @@ pub fn generate(config: SearchConfig) -> types::Search {
|
|||
})
|
||||
.collect();
|
||||
|
||||
items.sort_by(|a, b| a.label.as_str().cmp(b.label.as_str()));
|
||||
|
||||
types::Search {
|
||||
title: config.title,
|
||||
items,
|
||||
|
|
Loading…
Reference in New Issue
Block a user