From 00abd4c853bad6a13542c69c79c67f480b5ee5b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 19 Nov 2018 20:27:49 +0100 Subject: [PATCH] Add create endpoint, fixes #253, fixes #261 --- src/api/core/ciphers.rs | 4 ++++ src/api/core/mod.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/src/api/core/ciphers.rs b/src/api/core/ciphers.rs index 6a2ecd5a..a7395944 100644 --- a/src/api/core/ciphers.rs +++ b/src/api/core/ciphers.rs @@ -143,7 +143,11 @@ fn post_ciphers_admin(data: JsonUpcase, headers: Headers, conn: }; share_cipher_by_uuid(&cipher.uuid, data, &headers, &conn, &ws) +} +#[post("/ciphers/create", data = "")] +fn post_ciphers_create(data: JsonUpcase, headers: Headers, conn: DbConn, ws: State) -> JsonResult { + post_ciphers_admin(data, headers, conn, ws) } #[post("/ciphers", data = "")] diff --git a/src/api/core/mod.rs b/src/api/core/mod.rs index 4c748fd4..60f43daa 100644 --- a/src/api/core/mod.rs +++ b/src/api/core/mod.rs @@ -39,6 +39,7 @@ pub fn routes() -> Vec { post_ciphers, put_cipher_admin, post_ciphers_admin, + post_ciphers_create, post_ciphers_import, post_attachment, post_attachment_admin,