From 1dc6c6076074f3692b4d7c116c9779b18d545f09 Mon Sep 17 00:00:00 2001 From: SleeplessOne1917 Date: Mon, 13 Nov 2023 13:08:07 +0000 Subject: [PATCH] Make import and export settings endpoints reachable (#4143) * Make import and export settings endpoints reachable * Preserve original routes --- crates/utils/translations | 2 +- src/api_routes_http.rs | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/crates/utils/translations b/crates/utils/translations index 83540721c..8bb90fa4a 160000 --- a/crates/utils/translations +++ b/crates/utils/translations @@ -1 +1 @@ -Subproject commit 83540721c6035c701f4ef1daf7d95f78a51fedf7 +Subproject commit 8bb90fa4a30e6dc2ba4449794e99d6b3325bebb5 diff --git a/src/api_routes_http.rs b/src/api_routes_http.rs index fb784b3b3..5a1bb346f 100644 --- a/src/api_routes_http.rs +++ b/src/api_routes_http.rs @@ -260,6 +260,16 @@ pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimitCell) { .wrap(rate_limit.post()) .route(web::get().to(get_captcha)), ) + .service( + web::resource("/user/export_settings") + .wrap(rate_limit.import_user_settings()) + .route(web::get().to(export_settings)), + ) + .service( + web::resource("/user/import_settings") + .wrap(rate_limit.import_user_settings()) + .route(web::post().to(import_settings)), + ) // User actions .service( web::scope("/user") @@ -300,12 +310,6 @@ pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimitCell) { .route("/list_logins", web::get().to(list_logins)) .route("/validate_auth", web::get().to(validate_auth)), ) - .service( - web::scope("/user") - .wrap(rate_limit.import_user_settings()) - .route("/export_settings", web::get().to(export_settings)) - .route("/import_settings", web::post().to(import_settings)), - ) // Admin Actions .service( web::scope("/admin")