From b119f998e7aa2b1a61fbccd913bb05df12db65a9 Mon Sep 17 00:00:00 2001 From: Caleb Bourg Date: Wed, 11 Dec 2024 14:19:09 -0500 Subject: [PATCH] select distinct organizations --- entity_api/src/organization.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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