Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
callmeclover authored Apr 25, 2024
1 parent 6486411 commit dbf5c68
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/user/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ impl Default for DatabaseConnectix {
.max_connections(5)
.connect(&uri).await?;

return Ok(Self {
Ok(Self {
connection: client
});
})
})

}
Expand All @@ -30,9 +30,9 @@ impl DatabaseConnectix {
.max_connections(5)
.connect(uri).await?;

return Ok(Self {
Ok(Self {
connection: pool
});
})
})
}

Expand All @@ -55,7 +55,7 @@ impl DatabaseConnectix {

pub async fn post_user(&mut self, username: String, password: String) -> Result<()> {
let data: Model = Model {
id: self.get_user_id(username)?,
id: self.get_user_id(username).await?,
uuid: Uuid::new_v4(),
username,
password,
Expand All @@ -71,7 +71,7 @@ impl DatabaseConnectix {
}

pub async fn update_user(&mut self, username: &str, prev_username: &str, prev_id: i32) -> Result<()> {
let id = self.get_user_id(username)?;
let id = self.get_user_id(username).await?;

let _ = query("update users set username=$1, id=$2 where username=$3 and id=$4")
.bind(username).bind(id).bind(prev_username).bind(prev_id)
Expand Down

0 comments on commit dbf5c68

Please sign in to comment.