user-auth store test2

This commit is contained in:
2022-12-30 22:20:55 +05:30
parent ac80269c66
commit 08c41e2db9
6 changed files with 89 additions and 50 deletions

View File

@@ -26,6 +26,11 @@ impl Query {
Book::find_by_id(id).one(db).await
}
pub async fn find_user_by_id(db: &DbConn, id: i32) -> Result<Option<user::Model>, DbErr> {
User::find_by_id(id).one(db).await
}
pub async fn list_all_users(db: &DbConn) -> Result<Vec<user::Model>, DbErr> {
User::find().all(db).await
}