update unit tests; add location name in kiosk settting to cookie (to avoid specific redirects)
This commit is contained in:
@ -63,16 +63,17 @@ pub struct BoatToUpdate<'r> {
|
||||
|
||||
impl Boat {
|
||||
pub async fn find_by_id(db: &SqlitePool, id: i32) -> Option<Self> {
|
||||
sqlx::query_as!(
|
||||
Self,
|
||||
"SELECT id, name, amount_seats, location_id, owner, year_built, boatbuilder, default_shipmaster_only_steering, skull, external
|
||||
FROM boat
|
||||
WHERE id like ?",
|
||||
id
|
||||
)
|
||||
.fetch_one(db)
|
||||
.await
|
||||
.ok()
|
||||
sqlx::query_as!(Self, "SELECT * FROM boat WHERE id like ?", id)
|
||||
.fetch_one(db)
|
||||
.await
|
||||
.ok()
|
||||
}
|
||||
|
||||
pub async fn find_by_name(db: &SqlitePool, name: String) -> Option<Self> {
|
||||
sqlx::query_as!(Self, "SELECT * FROM boat WHERE name like ?", name)
|
||||
.fetch_one(db)
|
||||
.await
|
||||
.ok()
|
||||
}
|
||||
|
||||
pub async fn is_locked(&self, db: &SqlitePool) -> bool {
|
||||
|
Reference in New Issue
Block a user