Browse Source
Merge pull request #141 from mprasil/profile_update
Add PUT alias for profile update
pull/143/head
Daniel García
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
6 additions and
0 deletions
-
src/api/core/accounts.rs
-
src/api/core/mod.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; |
|
|
|
|
|
@ -14,6 +14,7 @@ pub fn routes() -> Vec<Route> { |
|
|
|
routes![ |
|
|
|
register, |
|
|
|
profile, |
|
|
|
put_profile, |
|
|
|
post_profile, |
|
|
|
get_public_keys, |
|
|
|
post_keys, |
|
|
|