This commit is contained in:
2023-05-17 17:31:48 +02:00
parent 04abb53f4a
commit 4b4a61d3bb
4 changed files with 83 additions and 59 deletions

View File

@@ -169,12 +169,6 @@ async fn inventory(
.populate_items(&state.database_pool)
.await
.map_err(|e| (StatusCode::INTERNAL_SERVER_ERROR, Html::from(e.to_string())))?;
if let Some(active_id) = active_id {
if category.id == active_id {
category.active = true;
}
}
}
Ok((
@@ -183,7 +177,12 @@ async fn inventory(
Root::build(
Inventory::build(state.client_state, categories)
.await
.map_err(|e| (StatusCode::INTERNAL_SERVER_ERROR, Html::from(e.to_string())))?
.map_err(|e| match e {
Error::NotFoundError { description } => {
(StatusCode::NOT_FOUND, Html::from(description))
}
_ => (StatusCode::INTERNAL_SERVER_ERROR, Html::from(e.to_string())),
})?
.into(),
&TopLevelPage::Inventory,
)