Browse Source

Add PUT alias for profile update

pull/141/head
Miroslav Prasil 7 years ago
parent
commit
12a2dc0901
  1. 5
      src/api/core/accounts.rs
  2. 1
      src/api/core/mod.rs

5
src/api/core/accounts.rs

@ -73,6 +73,11 @@ struct ProfileData {
Name: String,
}
#[put("/accounts/profile", data = "<data>")]
fn put_profile(data: JsonUpcase<ProfileData>, headers: Headers, conn: DbConn) -> JsonResult {
post_profile(data, headers, conn)
}
#[post("/accounts/profile", data = "<data>")]
fn post_profile(data: JsonUpcase<ProfileData>, headers: Headers, conn: DbConn) -> JsonResult {
let data: ProfileData = data.into_inner().data;

1
src/api/core/mod.rs

@ -14,6 +14,7 @@ pub fn routes() -> Vec<Route> {
routes![
register,
profile,
put_profile,
post_profile,
get_public_keys,
post_keys,

Loading…
Cancel
Save