BLOG-78 Backend image upload and download #84
@ -42,8 +42,11 @@ impl ImageRepository for ImageRepositoryImpl {
|
||||
|
||||
async fn get_image_by_id(&self, id: i32) -> Result<Image, ImageError> {
|
||||
let image_mapper = self.image_db_service.get_image_info_by_id(id).await?;
|
||||
let mut image = image_mapper.to_entity();
|
||||
image.data = self.image_storage.read_data(id)?;
|
||||
Ok(image)
|
||||
let data = self.image_storage.read_data(id)?;
|
||||
Ok(Image {
|
||||
id: image_mapper.id,
|
||||
mime_type: image_mapper.mime_type,
|
||||
data,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user