feat(safety): fetch reports and fetch snapshot API

This commit is contained in:
Paul Makles committed 2023-03-01 11:22:22 +00:00
1 parent 42b4906594
commit 304336d905
13 files changed
+93 -4

No files matched your search

@@ -10,4 +10,14 @@ impl AbstractSnapshot for MongoDb {
async fn insert_snapshot(&self, snapshot: &Snapshot) -> Result<()> {
self.insert_one(COL, snapshot).await.map(|_| ())
}
async fn fetch_snapshot(&self, report_id: &str) -> Result<Snapshot> {
self.find_one(
COL,
doc! {
"report_id": report_id
},
)
.await
}
}