Split up files and did some consistency work.
This commit is contained in:
@@ -78,20 +78,6 @@ where
|
||||
Ok(secret)
|
||||
}
|
||||
|
||||
fn classify_upsert_error(error: DatabaseError) -> RepositoryError {
|
||||
match &error {
|
||||
DatabaseError::ForeignKeyViolation {
|
||||
constraint: Constraint::UserAppSecretApp,
|
||||
..
|
||||
} => RepositoryError::ReferenceViolation {
|
||||
relation: ReferenceRelation::UserApp,
|
||||
kind: ReferenceViolationKind::Missing,
|
||||
source: error,
|
||||
},
|
||||
_ => RepositoryError::Database(error),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn verify<'e, E>(
|
||||
executor: E,
|
||||
app_id: Uuid,
|
||||
@@ -122,6 +108,20 @@ where
|
||||
Ok(secret)
|
||||
}
|
||||
|
||||
fn classify_upsert_error(error: DatabaseError) -> RepositoryError {
|
||||
match &error {
|
||||
DatabaseError::ForeignKeyViolation {
|
||||
constraint: Constraint::UserAppSecretApp,
|
||||
..
|
||||
} => RepositoryError::ReferenceViolation {
|
||||
relation: ReferenceRelation::UserApp,
|
||||
kind: ReferenceViolationKind::Missing,
|
||||
source: error,
|
||||
},
|
||||
_ => RepositoryError::Database(error),
|
||||
}
|
||||
}
|
||||
|
||||
fn decode(row: UserAppSecretRow) -> Result<UserAppSecret, DecodeError> {
|
||||
Ok(UserAppSecret::new(
|
||||
row.id,
|
||||
|
||||
Reference in New Issue
Block a user