Merge pull request #141 from mprasil/profile_update

Add PUT alias for profile update
This commit is contained in:
Daniel García authored and GitHub committed 2018-08-15 23:02:34 +02:00
commit e46fc62b78
2 files changed
+6

No files matched your search

+5
View File
@@ -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
View File
@@ -14,6 +14,7 @@ pub fn routes() -> Vec<Route> {
routes![
register,
profile,
put_profile,
post_profile,
get_public_keys,
post_keys,