fix(domain): from_db_str returns Result — unknown DB values are errors not silent defaults
This commit is contained in:
@@ -76,13 +76,18 @@ impl FollowRepository for PgFollowRepository {
|
||||
.fetch_optional(&self.pool)
|
||||
.await
|
||||
.into_domain()
|
||||
.map(|o| o.map(|r| Follow {
|
||||
follower_id: UserId::from_uuid(r.follower_id),
|
||||
following_id: UserId::from_uuid(r.following_id),
|
||||
state: FollowState::from_db_str(&r.state),
|
||||
ap_id: r.ap_id,
|
||||
created_at: r.created_at,
|
||||
}))
|
||||
.and_then(|o| {
|
||||
o.map(|r| {
|
||||
Ok(Follow {
|
||||
follower_id: UserId::from_uuid(r.follower_id),
|
||||
following_id: UserId::from_uuid(r.following_id),
|
||||
state: FollowState::from_db_str(&r.state)?,
|
||||
ap_id: r.ap_id,
|
||||
created_at: r.created_at,
|
||||
})
|
||||
})
|
||||
.transpose()
|
||||
})
|
||||
}
|
||||
|
||||
async fn update_state(
|
||||
|
||||
Reference in New Issue
Block a user