minor cleanup with traits
This commit is contained in:
parent
73f9c95e37
commit
8a37a7b2da
17 changed files with 81 additions and 71 deletions
|
|
@ -4,7 +4,7 @@ use sqlx::PgExecutor;
|
|||
use uuid::Uuid;
|
||||
|
||||
use crate::models::{CreateSceneRequest, Scene, SceneSummary, UpdateSceneRequest};
|
||||
use chattyness_error::AppError;
|
||||
use chattyness_error::{AppError, OptionExt};
|
||||
|
||||
/// List all scenes for a realm.
|
||||
pub async fn list_scenes_for_realm<'e>(
|
||||
|
|
@ -374,7 +374,7 @@ pub async fn update_scene<'e>(
|
|||
let scene = query_builder
|
||||
.fetch_optional(executor)
|
||||
.await?
|
||||
.ok_or_else(|| AppError::NotFound("Scene not found".to_string()))?;
|
||||
.or_not_found("Scene")?;
|
||||
|
||||
Ok(scene)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue