Update activity filter

This commit is contained in:
2023-01-07 18:23:22 +01:00
parent 0c32854275
commit e29446341f
2 changed files with 22 additions and 29 deletions

View File

@@ -127,26 +127,11 @@ pub async fn get_langs() -> Result<Vec<Lang>, Box<dyn std::error::Error + Send +
pub async fn update_user_activity(
user_id: UserId,
last_name: String,
first_name: String,
username: String,
source: String,
allowed_langs: Vec<String>,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let body = json!({
"user_id": user_id,
"last_name": last_name,
"first_name": first_name,
"username": username,
"source": source,
"allowed_langs": allowed_langs
});
let client = reqwest::Client::new();
let response = client
.post(format!("{}/users/{user_id}/update_activity", &config::CONFIG.user_settings_url))
.header("Authorization", &config::CONFIG.user_settings_api_key)
.body(body.to_string())
.send()
.await;