user: get one by id
This commit is contained in:
parent
5404fb1cf8
commit
e04de752ef
4 changed files with 111 additions and 0 deletions
|
|
@ -42,4 +42,13 @@ impl User {
|
|||
.await?,
|
||||
)
|
||||
}
|
||||
|
||||
pub async fn get_by_id(
|
||||
conn: impl SqliteExecutor<'_>,
|
||||
id: &UserID,
|
||||
) -> Result<Option<Self>, Error> {
|
||||
Ok(DatabaseUsers::get_one_by_id(conn, &id.0)
|
||||
.await?
|
||||
.map(Self::from))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue