notification (#282)
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m58s
CI/CD Pipeline / deploy-staging (push) Successful in 4m18s
CI/CD Pipeline / deploy-main (push) Has been skipped

Reviewed-on: #282
This commit is contained in:
2024-03-20 16:19:12 +01:00
parent 68a1153885
commit 9d14dae4a7
12 changed files with 274 additions and 22 deletions

View File

@ -46,6 +46,24 @@ WHERE id like ?
.ok()
}
pub async fn find_by_startingdatetime(
db: &SqlitePool,
day: String,
planned_starting_time: String,
) -> Vec<Self> {
sqlx::query_as!(
Self,
"
SELECT id, planned_starting_time, max_people, day, notes, allow_guests, trip_type_id, always_show, is_locked
FROM trip_details
WHERE day = ? AND planned_starting_time = ?
"
, day, planned_starting_time
)
.fetch_all(db)
.await.unwrap()
}
/// Creates a new entry in `trip_details` and returns its id.
pub async fn create(db: &SqlitePool, tripdetails: TripDetailsToAdd<'_>) -> i64 {
let query = sqlx::query!(