Begining of a RON API to edit profile

This commit is contained in:
Greg Burri 2024-11-14 01:59:40 +01:00
parent 37f6de7a89
commit 405aa68526
11 changed files with 229 additions and 68 deletions

View file

@ -251,6 +251,15 @@ FROM [UserLoginToken] WHERE [token] = $1
.map_err(DBError::from)
}
pub async fn set_user_name(&self, user_id: i64, name: &str) -> Result<()> {
sqlx::query("UPDATE [User] SET [name] = $2 WHERE [id] = $1")
.bind(user_id)
.bind(name)
.execute(&self.pool)
.await?;
Ok(())
}
pub async fn sign_up(&self, email: &str, password: &str) -> Result<SignUpResult> {
self.sign_up_with_given_time(email, password, Utc::now())
.await