forked from Ruderverein-Donau-Linz/rowt
Merge branch 'verify-rower-on-water' into 'staging'
push See merge request PhilippHofer/rot!21
This commit is contained in:
commit
332b505955
@ -95,7 +95,7 @@ WHERE name like ?
|
||||
}
|
||||
|
||||
pub async fn on_water(&self, db: &SqlitePool) -> bool {
|
||||
sqlx::query!(
|
||||
if sqlx::query!(
|
||||
"SELECT * FROM logbook WHERE shipmaster=? AND arrival is null",
|
||||
self.id
|
||||
)
|
||||
@ -103,6 +103,22 @@ WHERE name like ?
|
||||
.await
|
||||
.unwrap()
|
||||
.is_some()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if sqlx::query!(
|
||||
"SELECT * FROM logbook JOIN rower ON rower.logbook_id=logbook.id WHERE rower_id=? AND arrival is null",
|
||||
self.id
|
||||
)
|
||||
.fetch_optional(db)
|
||||
.await
|
||||
.unwrap()
|
||||
.is_some()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
pub async fn all(db: &SqlitePool) -> Vec<Self> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user