From 12a2dc0901d9b4daeff4a6534ded1daa5edaeb87 Mon Sep 17 00:00:00 2001 From: Miroslav Prasil Date: Wed, 15 Aug 2018 16:10:40 +0100 Subject: [PATCH] Add PUT alias for profile update --- src/api/core/accounts.rs | 5 +++++ src/api/core/mod.rs | 1 + 2 files changed, 6 insertions(+) diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs index fe26c4d4..cb6f83fa 100644 --- a/src/api/core/accounts.rs +++ b/src/api/core/accounts.rs @@ -73,6 +73,11 @@ struct ProfileData { Name: String, } +#[put("/accounts/profile", data = "")] +fn put_profile(data: JsonUpcase, headers: Headers, conn: DbConn) -> JsonResult { + post_profile(data, headers, conn) +} + #[post("/accounts/profile", data = "")] fn post_profile(data: JsonUpcase, headers: Headers, conn: DbConn) -> JsonResult { let data: ProfileData = data.into_inner().data; diff --git a/src/api/core/mod.rs b/src/api/core/mod.rs index 6c2966c2..b0c19122 100644 --- a/src/api/core/mod.rs +++ b/src/api/core/mod.rs @@ -14,6 +14,7 @@ pub fn routes() -> Vec { routes![ register, profile, + put_profile, post_profile, get_public_keys, post_keys,