From 2215bdf018c68338126045bfc15aff8396007afb Mon Sep 17 00:00:00 2001 From: Miroslav Prasil Date: Thu, 17 May 2018 23:03:08 +0100 Subject: [PATCH] Support editing collections from user vault --- src/api/core/ciphers.rs | 10 ++++++++++ src/api/core/mod.rs | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/api/core/ciphers.rs b/src/api/core/ciphers.rs index 55f2383a..afadcf9d 100644 --- a/src/api/core/ciphers.rs +++ b/src/api/core/ciphers.rs @@ -76,6 +76,11 @@ fn get_cipher_admin(uuid: String, headers: Headers, conn: DbConn) -> JsonResult get_cipher(uuid, headers, conn) } +#[get("/ciphers//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 { @@ -305,6 +310,11 @@ struct CollectionsAdminData { collectionIds: Vec, } +#[post("/ciphers//collections", data = "")] +fn post_collections_update(uuid: String, data: Json, headers: Headers, conn: DbConn) -> EmptyResult { + post_collections_admin(uuid, data, headers, conn) +} + #[post("/ciphers//collections-admin", data = "")] fn post_collections_admin(uuid: String, data: Json, headers: Headers, conn: DbConn) -> EmptyResult { let data: CollectionsAdminData = data.into_inner(); diff --git a/src/api/core/mod.rs b/src/api/core/mod.rs index daf1feeb..9d6df4f2 100644 --- a/src/api/core/mod.rs +++ b/src/api/core/mod.rs @@ -27,6 +27,7 @@ pub fn routes() -> Vec { get_ciphers, get_cipher, get_cipher_admin, + get_cipher_details, post_ciphers, post_ciphers_admin, post_ciphers_import, @@ -69,6 +70,7 @@ pub fn routes() -> Vec { post_organization_collections, post_organization_collection_update, post_organization_collection_delete, + post_collections_update, post_collections_admin, get_org_details, get_org_users,