Skip to content

Commit

Permalink
Rename function to mention swapping uuid's
Browse files Browse the repository at this point in the history
Signed-off-by: BlackDex <[email protected]>
  • Loading branch information
BlackDex committed Jan 1, 2025
1 parent 296e45b commit f0836bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api/core/organizations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, i32> = UserOrganization::find_confirmed_by_org(org_id, &mut conn)
Expand Down
5 changes: 4 additions & 1 deletion src/db/models/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,10 @@ impl CollectionUser {
}}
}

pub async fn find_by_organization(org_uuid: &str, conn: &mut DbConn) -> Vec<Self> {
pub async fn find_by_organization_swap_user_uuid_with_org_user_uuid(
org_uuid: &str,
conn: &mut DbConn,
) -> Vec<Self> {
db_run! { conn: {
users_collections::table
.inner_join(collections::table.on(collections::uuid.eq(users_collections::collection_uuid)))
Expand Down

0 comments on commit f0836bb

Please sign in to comment.