mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 07:09:59 -07:00
general: add /api/last route
This commit is contained in:
@@ -286,6 +286,13 @@ where
|
||||
&self.path_last
|
||||
}
|
||||
|
||||
fn last_value(&self) -> Option<serde_json::Value> {
|
||||
self.imported
|
||||
.last_key_value()
|
||||
.and_then(|(_, serialized)| serialized.last())
|
||||
.and_then(|v| serde_json::to_value(v).ok())
|
||||
}
|
||||
|
||||
fn t_name(&self) -> &str {
|
||||
std::any::type_name::<Value>()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user