fix: remove timezone-broken future-date check from Review::new
This commit is contained in:
@@ -133,14 +133,6 @@ impl Review {
|
|||||||
comment: Option<Comment>,
|
comment: Option<Comment>,
|
||||||
watched_at: NaiveDateTime,
|
watched_at: NaiveDateTime,
|
||||||
) -> Result<Self, DomainError> {
|
) -> Result<Self, DomainError> {
|
||||||
let now = Utc::now().naive_utc();
|
|
||||||
|
|
||||||
if watched_at > now {
|
|
||||||
return Err(DomainError::ValidationError(
|
|
||||||
"watched_at cannot be in the future".into(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
id: ReviewId::generate(),
|
id: ReviewId::generate(),
|
||||||
movie_id,
|
movie_id,
|
||||||
@@ -148,7 +140,7 @@ impl Review {
|
|||||||
rating,
|
rating,
|
||||||
comment,
|
comment,
|
||||||
watched_at,
|
watched_at,
|
||||||
created_at: now,
|
created_at: Utc::now().naive_utc(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user