mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-25 04:52:05 +00:00
feat: find session by uuid
This commit is contained in:
parent
9378dcbead
commit
69b5a4fabf
1 changed files with 6 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
use ::entity::{candidate, candidate::Entity as Candidate};
|
||||
use ::entity::{session, session::Entity as Session};
|
||||
use sea_orm::*;
|
||||
use sea_orm::prelude::Uuid;
|
||||
|
||||
pub struct Query;
|
||||
|
||||
|
|
@ -7,4 +9,8 @@ impl Query {
|
|||
pub async fn find_candidate_by_id(db: &DbConn, id: i32) -> Result<Option<candidate::Model>, DbErr> {
|
||||
Candidate::find_by_id(id).one(db).await
|
||||
}
|
||||
|
||||
pub async fn find_session_by_uuid(db: &DbConn, uuid: Uuid) -> Result<Option<session::Model>, DbErr> {
|
||||
Session::find_by_id(uuid).one(db).await
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue