Split up files and did some consistency work.
This commit is contained in:
@@ -88,20 +88,6 @@ where
|
||||
Ok(app)
|
||||
}
|
||||
|
||||
fn classify_upsert_error(error: DatabaseError) -> RepositoryError {
|
||||
match &error {
|
||||
DatabaseError::ForeignKeyViolation {
|
||||
constraint: Constraint::UserAppUser,
|
||||
..
|
||||
} => RepositoryError::ReferenceViolation {
|
||||
relation: super::ReferenceRelation::User,
|
||||
kind: super::ReferenceViolationKind::Missing,
|
||||
source: error,
|
||||
},
|
||||
_ => RepositoryError::Database(error),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn delete_by_id<'e, E>(
|
||||
executor: E,
|
||||
user_id: Uuid,
|
||||
@@ -118,6 +104,20 @@ where
|
||||
Ok(app)
|
||||
}
|
||||
|
||||
fn classify_upsert_error(error: DatabaseError) -> RepositoryError {
|
||||
match &error {
|
||||
DatabaseError::ForeignKeyViolation {
|
||||
constraint: Constraint::UserAppUser,
|
||||
..
|
||||
} => RepositoryError::ReferenceViolation {
|
||||
relation: super::ReferenceRelation::User,
|
||||
kind: super::ReferenceViolationKind::Missing,
|
||||
source: error,
|
||||
},
|
||||
_ => RepositoryError::Database(error),
|
||||
}
|
||||
}
|
||||
|
||||
fn decode(row: UserAppRow) -> Result<UserApp, DecodeError> {
|
||||
Ok(UserApp {
|
||||
id: row.id,
|
||||
|
||||
Reference in New Issue
Block a user