Skip to content

Commit

Permalink
Merge pull request #24 from mprasil/myvault_collections
Browse files Browse the repository at this point in the history
Support editing collections from user vault
  • Loading branch information
dani-garcia authored May 19, 2018
2 parents e301e69 + 2215bdf commit 726ba36
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/api/core/ciphers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fn get_cipher_admin(uuid: String, headers: Headers, conn: DbConn) -> JsonResult
get_cipher(uuid, headers, conn)
}

#[get("/ciphers/<uuid>/details")]
fn get_cipher_details(uuid: String, headers: Headers, conn: DbConn) -> JsonResult {
get_cipher(uuid, headers, conn)
}

#[derive(Deserialize, Debug)]
#[allow(non_snake_case)]
struct CipherData {
Expand Down Expand Up @@ -306,6 +311,11 @@ struct CollectionsAdminData {
collectionIds: Vec<String>,
}

#[post("/ciphers/<uuid>/collections", data = "<data>")]
fn post_collections_update(uuid: String, data: Json<CollectionsAdminData>, headers: Headers, conn: DbConn) -> EmptyResult {
post_collections_admin(uuid, data, headers, conn)
}

#[post("/ciphers/<uuid>/collections-admin", data = "<data>")]
fn post_collections_admin(uuid: String, data: Json<CollectionsAdminData>, headers: Headers, conn: DbConn) -> EmptyResult {
let data: CollectionsAdminData = data.into_inner();
Expand Down
2 changes: 2 additions & 0 deletions src/api/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub fn routes() -> Vec<Route> {
get_ciphers,
get_cipher,
get_cipher_admin,
get_cipher_details,
post_ciphers,
post_ciphers_admin,
post_ciphers_import,
Expand Down Expand Up @@ -69,6 +70,7 @@ pub fn routes() -> Vec<Route> {
post_organization_collections,
post_organization_collection_update,
post_organization_collection_delete,
post_collections_update,
post_collections_admin,
get_org_details,
get_org_users,
Expand Down

0 comments on commit 726ba36

Please sign in to comment.