add latest price route
This commit is contained in:
parent
0d4ed15460
commit
9c03d38f6e
3 changed files with 31 additions and 4 deletions
|
@ -225,14 +225,14 @@ impl Variant {
|
|||
)
|
||||
}
|
||||
|
||||
pub async fn price_history_by_origin(&self, origin: &str) -> Vec<Price> {
|
||||
pub async fn price_history_by_origin(&self, origin: &str, limit: Option<i64>) -> Vec<Price> {
|
||||
Transaction::find(
|
||||
doc! {
|
||||
"item": &self.item,
|
||||
"variant": &self.variant,
|
||||
"origin": origin
|
||||
},
|
||||
None,
|
||||
limit,
|
||||
Some(sort_by_timestamp()),
|
||||
)
|
||||
.await
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue