minor cleanup with traits

This commit is contained in:
Evan Carroll 2026-01-23 18:27:54 -06:00
parent 73f9c95e37
commit 8a37a7b2da
17 changed files with 81 additions and 71 deletions

View file

@ -11,7 +11,7 @@ use chattyness_db::{
models::{Scene, SceneSummary, Spot, SpotSummary},
queries::{realms, scenes, spots},
};
use chattyness_error::AppError;
use chattyness_error::{AppError, OptionExt};
/// Get the entry scene for a realm.
///
@ -86,7 +86,7 @@ pub async fn get_spot(
) -> Result<Json<Spot>, AppError> {
let spot = spots::get_spot_by_id(&pool, spot_id)
.await?
.ok_or_else(|| AppError::NotFound("Spot not found".to_string()))?;
.or_not_found("Spot")?;
Ok(Json(spot))
}