all names endpoint

This commit is contained in:
2026-04-09 14:30:56 +02:00
parent 3eb1da8319
commit cec765bcf3
2 changed files with 6 additions and 0 deletions

View File

@@ -93,6 +93,11 @@ pub async fn add_name(
Ok((StatusCode::CREATED, Json(n)).into_response())
}
pub async fn n_all(headers: HeaderMap) -> Result<Response, CompositeError> {
User::authenticate(&headers)?.required()?;
let conn = database::conn()?;
Ok(Json(Name::get_all(&conn)?).into_response())
}
pub async fn n_by_id(Path(id): Path<Uuid>, headers: HeaderMap) -> Result<Response, CompositeError> {
User::authenticate(&headers)?.required()?;
let conn = database::conn()?;