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;
|
use crate::sys::search::types;
|
||||||
|
|
||||||
pub fn generate(config: SearchConfig) -> types::Search {
|
pub fn generate(config: SearchConfig) -> types::Search {
|
||||||
let items = config
|
let mut items: Vec<types::SearchItem> = config
|
||||||
.items
|
.items
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|item| types::SearchItem {
|
.map(|item| types::SearchItem {
|
||||||
|
@ -32,6 +32,8 @@ pub fn generate(config: SearchConfig) -> types::Search {
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
items.sort_by(|a, b| a.label.as_str().cmp(b.label.as_str()));
|
||||||
|
|
||||||
types::Search {
|
types::Search {
|
||||||
title: config.title,
|
title: config.title,
|
||||||
items,
|
items,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user