commit 80414f845270dc473f63d47b2baf45a8ddd11c34
parent 9d027b96d84c25ffef3e3494f69ad655fd3f36f5
Author: Daniel GarcĂa <dani-garcia@users.noreply.github.com>
Date: Fri, 25 Jan 2019 16:52:27 +0100
Merge pull request #365 from CoreFiling/master
Fix the list of users with access to a collection to display correctly.
Diffstat:
2 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs
@@ -375,11 +375,7 @@ fn get_collection_users(org_id: String, coll_id: String, _headers: AdminHeaders,
})
.collect();
- Ok(Json(json!({
- "Data": user_list,
- "Object": "list",
- "ContinuationToken": null,
- })))
+ Ok(Json(json!(user_list)))
}
#[derive(FromForm)]
diff --git a/src/db/models/organization.rs b/src/db/models/organization.rs
@@ -293,17 +293,9 @@ impl UserOrganization {
}
pub fn to_json_collection_user_details(&self, read_only: bool, conn: &DbConn) -> Value {
- let user = User::find_by_uuid(&self.user_uuid, conn).unwrap();
-
json!({
- "OrganizationUserId": self.uuid,
- "AccessAll": self.access_all,
- "Name": user.name,
- "Email": user.email,
- "Type": self.type_,
- "Status": self.status,
- "ReadOnly": read_only,
- "Object": "collectionUser",
+ "Id": self.uuid,
+ "ReadOnly": read_only
})
}