Skip to content

Commit a2bf8de

Browse files
authored
Change API and structs to camelCase (dani-garcia#4386)
* Change API inputs/outputs and structs to camelCase * Fix fields and password history * Use convert_json_key_lcase_first * Make sends lowercase * Update admin and templates * Update org revoke * Fix sends expecting size to be a string on mobile * Convert two-factor providers to string
1 parent 8f05a90 commit a2bf8de

37 files changed

+1953
-2006
lines changed

src/api/admin.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ fn admin_page_login() -> ApiResult<Html<String>> {
265265
render_admin_login(None, None)
266266
}
267267

268-
#[derive(Deserialize, Debug)]
269-
#[allow(non_snake_case)]
268+
#[derive(Debug, Deserialize)]
269+
#[serde(rename_all = "camelCase")]
270270
struct InviteData {
271271
email: String,
272272
}
@@ -326,9 +326,9 @@ async fn get_users_json(_token: AdminToken, mut conn: DbConn) -> Json<Value> {
326326
let mut users_json = Vec::with_capacity(users.len());
327327
for u in users {
328328
let mut usr = u.to_json(&mut conn).await;
329-
usr["UserEnabled"] = json!(u.enabled);
330-
usr["CreatedAt"] = json!(format_naive_datetime_local(&u.created_at, DT_FMT));
331-
usr["LastActive"] = match u.last_active(&mut conn).await {
329+
usr["userEnabled"] = json!(u.enabled);
330+
usr["createdAt"] = json!(format_naive_datetime_local(&u.created_at, DT_FMT));
331+
usr["lastActive"] = match u.last_active(&mut conn).await {
332332
Some(dt) => json!(format_naive_datetime_local(&dt, DT_FMT)),
333333
None => json!(None::<String>),
334334
};
@@ -475,7 +475,7 @@ async fn resend_user_invite(uuid: &str, _token: AdminToken, mut conn: DbConn) ->
475475
}
476476
}
477477

478-
#[derive(Deserialize, Debug)]
478+
#[derive(Debug, Deserialize)]
479479
struct UserOrgTypeData {
480480
user_type: NumberOrString,
481481
user_uuid: String,

0 commit comments

Comments
 (0)