BLOG-94 refactor: change image ID from Option<i32> to i32 in Image struct and related mappers
All checks were successful
Frontend CI / build (push) Successful in 1m12s
All checks were successful
Frontend CI / build (push) Successful in 1m12s
This commit is contained in:
parent
e8f7f96677
commit
8f8857ee8e
@ -8,7 +8,7 @@ pub struct ImageRequestDto {
|
||||
impl ImageRequestDto {
|
||||
pub fn into_entity(self) -> Image {
|
||||
Image {
|
||||
id: None,
|
||||
id: -1,
|
||||
mime_type: self.mime_type,
|
||||
data: self.data,
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::domain::entity::image::Image;
|
||||
|
||||
pub struct ImageDbMapper {
|
||||
pub id: Option<i32>,
|
||||
pub id: i32,
|
||||
pub mime_type: String,
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
pub struct Image {
|
||||
pub id: Option<i32>,
|
||||
pub id: i32,
|
||||
pub mime_type: String,
|
||||
pub data: Vec<u8>,
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ impl ImageDbService for ImageDbServiceImpl {
|
||||
match image_record {
|
||||
Ok(record) => match record {
|
||||
Some(record) => Ok(ImageDbMapper {
|
||||
id: Some(record.id),
|
||||
id: record.id,
|
||||
mime_type: record.mime_type,
|
||||
}),
|
||||
None => Err(ImageError::NotFound),
|
||||
|
Loading…
x
Reference in New Issue
Block a user