mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-26 16:21:07 +00:00
Return a new error when the sort criteria is not sortable
This commit is contained in:
@ -64,6 +64,15 @@ pub enum AscDesc {
|
||||
Desc(String),
|
||||
}
|
||||
|
||||
impl AscDesc {
|
||||
pub fn field(&self) -> &str {
|
||||
match self {
|
||||
AscDesc::Asc(field) => field,
|
||||
AscDesc::Desc(field) => field,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for AscDesc {
|
||||
type Err = UserError;
|
||||
|
||||
|
Reference in New Issue
Block a user