Skip to content

Commit

Permalink
fixup! List manifest return manifest data struct
Browse files Browse the repository at this point in the history
  • Loading branch information
FirelightFlagboy committed Jul 31, 2024
1 parent 44481cf commit bdfca50
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions libparsec/crates/platform_storage/src/web/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,21 @@ impl PlatformWorkspaceStorage {
&mut self,
page: u32,
limit: u32,
) -> anyhow::Result<Vec<RawEncryptedManifest>> {
Vlob::list(&self.conn, page, limit)
.await
.map(|vlobs| vlobs.into_iter().map(|vlob| vlob.blob.to_vec()).collect())
) -> anyhow::Result<Vec<ManifestData>> {
Vlob::list(&self.conn, page, limit).await.and_then(|vlobs| {
vlobs
.into_iter()
.map(|vlob| {
Ok(ManifestData {
entry_id: VlobID::try_from(vlob.vlob_id.as_ref())
.map_err(|e| anyhow::anyhow!("{e}"))?,
encrypted: Vec::from(vlob.blob),
need_sync: vlob.need_sync,
base_version: vlob.base_version,
})
})
.collect::<anyhow::Result<_>>()
})
}

pub async fn get_chunk(&mut self, chunk_id: ChunkID) -> anyhow::Result<Option<Vec<u8>>> {
Expand Down

0 comments on commit bdfca50

Please sign in to comment.