Explorar el Código

Rename to_json_list to to_json_provder to reflect the response model

theycallmesteve hace 5 años
padre
commit
dfdf4473ea
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  1. 1 1
      src/api/core/two_factor/mod.rs
  2. 1 1
      src/db/models/two_factor.rs

+ 1 - 1
src/api/core/two_factor/mod.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,

+ 1 - 1
src/db/models/two_factor.rs

@@ -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,