From f2fec345ec0fa25a4a07d661f6760c85df6be8fa Mon Sep 17 00:00:00 2001 From: Miroslav Prasil Date: Wed, 15 Aug 2018 14:27:37 +0100 Subject: [PATCH] Add PUT alias for editing cipher --- src/api/core/ciphers.rs | 7 ++++++- src/api/core/mod.rs | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/api/core/ciphers.rs b/src/api/core/ciphers.rs index 2c60f0d2..beb68e05 100644 --- a/src/api/core/ciphers.rs +++ b/src/api/core/ciphers.rs @@ -251,9 +251,14 @@ fn post_ciphers_import(data: JsonUpcase, headers: Headers, conn: DbC } } + +#[put("/ciphers//admin", data = "")] +fn put_cipher_admin(uuid: String, data: JsonUpcase, headers: Headers, conn: DbConn) -> JsonResult { + put_cipher(uuid, data, headers, conn) +} + #[post("/ciphers//admin", data = "")] fn post_cipher_admin(uuid: String, data: JsonUpcase, headers: Headers, conn: DbConn) -> JsonResult { - // TODO: Implement this correctly post_cipher(uuid, data, headers, conn) } diff --git a/src/api/core/mod.rs b/src/api/core/mod.rs index 6c2966c2..079460a0 100644 --- a/src/api/core/mod.rs +++ b/src/api/core/mod.rs @@ -32,6 +32,7 @@ pub fn routes() -> Vec { get_cipher_admin, get_cipher_details, post_ciphers, + put_cipher_admin, post_ciphers_admin, post_ciphers_import, post_attachment,