These errors have become app level errors.
This commit is contained in:
@@ -9,7 +9,7 @@ use super::{
|
||||
};
|
||||
use crate::{
|
||||
error::AppError,
|
||||
repository::{self, ReferenceRelation, RepositoryError},
|
||||
repository::{self, RepositoryError},
|
||||
};
|
||||
|
||||
pub fn create_router() -> axum::Router<PgPool> {
|
||||
@@ -81,10 +81,7 @@ async fn upsert_user_app(
|
||||
.as_ref()
|
||||
.is_some_and(|previous| previous.user_id != user_id)
|
||||
{
|
||||
return Err(RepositoryError::OwnershipConflict {
|
||||
relation: ReferenceRelation::UserApp,
|
||||
}
|
||||
.into());
|
||||
return Err(AppError::Conflict("User app ID is already in use".into()).into());
|
||||
}
|
||||
tx.commit().await.map_err(RepositoryError::from)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user