From f0836bbf6e4ee70c074f13e84e3db494044fdc04 Mon Sep 17 00:00:00 2001 From: BlackDex Date: Mon, 30 Dec 2024 17:15:53 +0100 Subject: [PATCH] Rename function to mention swapping uuid's Signed-off-by: BlackDex --- src/api/core/organizations.rs | 2 +- src/db/models/collection.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs index b1a4dd033e9..eff7b8e25e0 100644 --- a/src/api/core/organizations.rs +++ b/src/api/core/organizations.rs @@ -325,7 +325,7 @@ async fn get_org_collections_details(org_id: &str, headers: ManagerHeadersLoose, }; // get all collection memberships for the current organization - let coll_users = CollectionUser::find_by_organization(org_id, &mut conn).await; + let coll_users = CollectionUser::find_by_organization_swap_user_uuid_with_org_user_uuid(org_id, &mut conn).await; // Generate a HashMap to get the correct UserOrgType per user to determine the manage permission // We use the uuid instead of the user_uuid here, since that is what is used in CollectionUser let users_org_type: HashMap = UserOrganization::find_confirmed_by_org(org_id, &mut conn) diff --git a/src/db/models/collection.rs b/src/db/models/collection.rs index a26f22c72e6..907aebf7a83 100644 --- a/src/db/models/collection.rs +++ b/src/db/models/collection.rs @@ -511,7 +511,10 @@ impl CollectionUser { }} } - pub async fn find_by_organization(org_uuid: &str, conn: &mut DbConn) -> Vec { + pub async fn find_by_organization_swap_user_uuid_with_org_user_uuid( + org_uuid: &str, + conn: &mut DbConn, + ) -> Vec { db_run! { conn: { users_collections::table .inner_join(collections::table.on(collections::uuid.eq(users_collections::collection_uuid)))