diff --git a/entity_api/src/organization.rs b/entity_api/src/organization.rs index 4d63a7f..1d58344 100644 --- a/entity_api/src/organization.rs +++ b/entity_api/src/organization.rs @@ -107,7 +107,7 @@ pub async fn find_by( } } - Ok(query.all(db).await?) + Ok(query.distinct().all(db).await?) } pub async fn find_by_user(db: &DatabaseConnection, user_id: Id) -> Result, Error> { @@ -124,6 +124,7 @@ async fn by_user(query: Select, user_id: Id) -> Select