update unit tests; add location name in kiosk settting to cookie (to avoid specific redirects)

This commit is contained in:
2023-08-05 13:21:35 +02:00
parent e459a4e2d9
commit 7309b1f2b2
4 changed files with 48 additions and 15 deletions

View File

@ -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 {