From 74e2ca81ae5c1a5017ce2f5fc5811611ff71d8b4 Mon Sep 17 00:00:00 2001 From: Kumar Ankur Date: Thu, 2 Aug 2018 00:07:14 +0530 Subject: [PATCH] Implemented PUT for single cipher sharing (#97) --- src/api/core/ciphers.rs | 5 +++++ src/api/core/mod.rs | 1 + 2 files changed, 6 insertions(+) diff --git a/src/api/core/ciphers.rs b/src/api/core/ciphers.rs index 4880d93a..0c8b0a2f 100644 --- a/src/api/core/ciphers.rs +++ b/src/api/core/ciphers.rs @@ -365,6 +365,11 @@ fn post_cipher_share(uuid: String, data: JsonUpcase, headers: H } } +#[put("/ciphers//share", data = "")] +fn put_cipher_share(uuid: String, data: JsonUpcase, headers: Headers, conn: DbConn) -> JsonResult { + post_cipher_share(uuid, data, headers, conn) +} + #[post("/ciphers//attachment", format = "multipart/form-data", data = "")] fn post_attachment(uuid: String, data: Data, content_type: &ContentType, headers: Headers, conn: DbConn) -> JsonResult { let cipher = match Cipher::find_by_uuid(&uuid, &conn) { diff --git a/src/api/core/mod.rs b/src/api/core/mod.rs index 4b8d270f..479318c5 100644 --- a/src/api/core/mod.rs +++ b/src/api/core/mod.rs @@ -41,6 +41,7 @@ pub fn routes() -> Vec { delete_attachment, post_cipher_admin, post_cipher_share, + put_cipher_share, post_cipher, put_cipher, delete_cipher_post,