Browse Source
Rename to_json_list to to_json_provder to reflect the response model
pull/988/head
theycallmesteve
5 years ago
No known key found for this signature in database
GPG Key ID: 6240923F65CC698D
2 changed files with
2 additions and
2 deletions
-
src/api/core/two_factor/mod.rs
-
src/db/models/two_factor.rs
|
|
@ -38,7 +38,7 @@ pub fn routes() -> Vec<Route> { |
|
|
|
#[get("/two-factor")] |
|
|
|
fn get_twofactor(headers: Headers, conn: DbConn) -> JsonResult { |
|
|
|
let twofactors = TwoFactor::find_by_user(&headers.user.uuid, &conn); |
|
|
|
let twofactors_json: Vec<Value> = twofactors.iter().map(TwoFactor::to_json_list).collect(); |
|
|
|
let twofactors_json: Vec<Value> = twofactors.iter().map(TwoFactor::to_json_provider).collect(); |
|
|
|
|
|
|
|
Ok(Json(json!({ |
|
|
|
"Data": twofactors_json, |
|
|
|
|
|
@ -59,7 +59,7 @@ impl TwoFactor { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
pub fn to_json_list(&self) -> Value { |
|
|
|
pub fn to_json_provider(&self) -> Value { |
|
|
|
json!({ |
|
|
|
"Enabled": self.enabled, |
|
|
|
"Type": self.atype, |
|
|
|