1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-06-02 05:48:59 +02:00

Query returns UUID only

Dieser Commit ist enthalten in:
matlink 2023-08-05 12:20:29 +02:00 committet von Matlink
Ursprung bb100df31a
Commit f4e9857dfd

Datei anzeigen

@ -488,27 +488,19 @@ impl GroupUser {
}}
}
pub async fn find_by_collection(collection_uuid: &str, conn: &mut DbConn) -> Vec<Self> {
pub async fn get_collection_group_users_uuid(collection_uuid: &str, conn: &mut DbConn) -> HashSet<String> {
db_run! { conn: {
groups_users::table
.inner_join(collections_groups::table.on(
collections_groups::groups_uuid.eq(groups_users::groups_uuid)
))
.filter(collections_groups::collections_uuid.eq(collection_uuid))
.select(groups_users::all_columns)
.load::<GroupUserDb>(conn)
.select(groups_users::users_organizations_uuid)
.load::<String>(conn)
.expect("Error loading group users for collection")
.from_db()
}}
}
/// returns uuid of members of collection groups
pub async fn get_collection_group_users_uuid(collection_uuid: &str, conn: &mut DbConn) -> HashSet<String> {
GroupUser::find_by_collection(collection_uuid, conn)
.await
.iter()
.map(|u| u.users_organizations_uuid.clone())
.collect()
.into_iter()
.collect()
}
pub async fn update_user_revision(&self, conn: &mut DbConn) {