Begining of a RON API to edit profile
This commit is contained in:
parent
37f6de7a89
commit
405aa68526
11 changed files with 229 additions and 68 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue