Translation support + french.

This commit is contained in:
Greg Burri 2025-01-06 16:04:48 +01:00
parent e9873c1943
commit f059d3c61f
16 changed files with 380 additions and 169 deletions

View file

@ -7,6 +7,7 @@ use crate::{
consts,
data::model,
hash::{hash, verify_password},
services::user,
};
#[derive(Debug)]
@ -162,6 +163,16 @@ WHERE [id] = $1
})
}
pub async fn set_user_lang(&self, user_id: i64, lang: &str) -> Result<()> {
sqlx::query("UPDATE [User] SET [lang] = $2 WHERE [id] = $1")
.bind(user_id)
.bind(lang)
.execute(&self.pool)
.await
.map(|_| ())
.map_err(DBError::from)
}
pub async fn sign_up(&self, email: &str, password: &str) -> Result<SignUpResult> {
self.sign_up_with_given_time(email, password, Utc::now())
.await