This commit is contained in:
Andras Schmelczer 2025-03-16 15:38:13 +00:00
parent 7eb740cd4c
commit 9f09b07de9
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
16 changed files with 191 additions and 114 deletions

View file

@ -39,12 +39,14 @@ pub async fn fetch_document_version(
.get_document_version(&vault_id, vault_update_id, None)
.await
.map_err(server_error)?
.map(Ok)
.unwrap_or_else(|| {
Err(not_found_error(anyhow!(
"Document with vault update id `{vault_update_id}` not found",
)))
})?;
.map_or_else(
|| {
Err(not_found_error(anyhow!(
"Document with vault update id `{vault_update_id}` not found",
)))
},
Ok,
)?;
if result.document_id != document_id {
return Err(not_found_error(anyhow!(