bug fixed
This commit is contained in:
parent
bb6c77004f
commit
0c51ea8b76
|
@ -10,26 +10,26 @@ pub enum Sort {
|
||||||
DESC(String),
|
DESC(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Sort> for bpr::protobuf::pagination::Sort {
|
impl From<&Sort> for bpr::protobuf::pagination::Sort {
|
||||||
fn from(d: Sort) -> Self {
|
fn from(d: &Sort) -> Self {
|
||||||
match d {
|
match d {
|
||||||
Sort::ASC(by) => bpr::protobuf::pagination::Sort {
|
Sort::ASC(by) => bpr::protobuf::pagination::Sort {
|
||||||
by,
|
by: by.to_string(),
|
||||||
order: bpr::protobuf::pagination::SortOrder::Asc as i32,
|
order: bpr::protobuf::pagination::SortOrder::Asc as i32,
|
||||||
},
|
},
|
||||||
Sort::DESC(by) => bpr::protobuf::pagination::Sort {
|
Sort::DESC(by) => bpr::protobuf::pagination::Sort {
|
||||||
by,
|
by: by.to_string(),
|
||||||
order: bpr::protobuf::pagination::SortOrder::Desc as i32,
|
order: bpr::protobuf::pagination::SortOrder::Desc as i32,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<bpr::protobuf::pagination::Sort> for Sort {
|
impl From<&bpr::protobuf::pagination::Sort> for Sort {
|
||||||
fn from(d: bpr::protobuf::pagination::Sort) -> Self {
|
fn from(d: &bpr::protobuf::pagination::Sort) -> Self {
|
||||||
match d.order {
|
match d.order {
|
||||||
x if x == bpr::protobuf::pagination::SortOrder::Desc as i32 => Sort::DESC(d.by),
|
x if x == bpr::protobuf::pagination::SortOrder::Desc as i32 => Sort::DESC(d.by.to_string()),
|
||||||
_ => Sort::ASC(d.by),
|
_ => Sort::ASC(d.by.to_string()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user