Browse Source
Merge pull request #189 from mprasil/delete_fix
Add alias for DELETE call on accounts
pull/191/head
Daniel García
6 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
|
@ -238,6 +238,11 @@ fn post_email(data: JsonUpcase<ChangeEmailData>, headers: Headers, conn: DbConn) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#[post("/accounts/delete", data = "<data>")] |
|
|
#[post("/accounts/delete", data = "<data>")] |
|
|
|
|
|
fn post_delete_account(data: JsonUpcase<PasswordData>, headers: Headers, conn: DbConn) -> EmptyResult { |
|
|
|
|
|
delete_account(data, headers, conn) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[delete("/accounts", data = "<data>")] |
|
|
fn delete_account(data: JsonUpcase<PasswordData>, headers: Headers, conn: DbConn) -> EmptyResult { |
|
|
fn delete_account(data: JsonUpcase<PasswordData>, headers: Headers, conn: DbConn) -> EmptyResult { |
|
|
let data: PasswordData = data.into_inner().data; |
|
|
let data: PasswordData = data.into_inner().data; |
|
|
let user = headers.user; |
|
|
let user = headers.user; |
|
|
|
@ -23,6 +23,7 @@ pub fn routes() -> Vec<Route> { |
|
|
post_email_token, |
|
|
post_email_token, |
|
|
post_email, |
|
|
post_email, |
|
|
delete_account, |
|
|
delete_account, |
|
|
|
|
|
post_delete_account, |
|
|
revision_date, |
|
|
revision_date, |
|
|
password_hint, |
|
|
password_hint, |
|
|
prelogin, |
|
|
prelogin, |
|
|