Add support for adding and viewing of org ciphers

This commit is contained in:
Miroslav Prasil
2018-04-27 12:49:34 +01:00
parent 9c46d2f72d
commit 7e9e200d29
4 changed files with 30 additions and 12 deletions

View File

@@ -229,12 +229,12 @@ struct OrgIdData {
#[get("/ciphers/organization-details?<data>")]
fn get_org_details(data: OrgIdData, headers: Headers, conn: DbConn) -> JsonResult {
// Get list of ciphers in org?
let ciphers = Cipher::find_by_org(&data.organizationId, &conn);
let ciphers_json: Vec<Value> = ciphers.iter().map(|c| c.to_json(&headers.host, &conn)).collect();
Ok(Json(json!({
"Data": [],
"Object": "list"
"Data": ciphers_json,
"Object": "list",
})))
}