Improve database errors (NotFound -> Option)

This commit is contained in:
Tobias Reisinger 2023-11-27 13:33:04 +01:00
parent be7f31906c
commit 8dab4b9a50
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
9 changed files with 96 additions and 78 deletions
emgauwa-lib/src/models

View file

@ -38,8 +38,7 @@ impl Schedule {
impl Relay {
pub fn from_db_relay(relay: db::DbRelay, conn: &mut PoolConnection<Sqlite>) -> Self {
let relay = relay.clone();
let controller =
executor::block_on(db::DbController::get(conn, relay.controller_id)).unwrap();
let controller = executor::block_on(relay.get_controller(conn)).unwrap();
let tags = executor::block_on(relay.get_tags(conn)).unwrap();
Relay {