style(api): import reindex into scope rather than crate::-qualify

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-02 23:29:50 +02:00
parent d15afda9b2
commit 4921c73fa7
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize};
use tower_sessions::Session; use tower_sessions::Session;
use utoipa::ToSchema; use utoipa::ToSchema;
use crate::AppState; use crate::{AppState, reindex};
/// Credentials for password login. /// Credentials for password login.
#[derive(Deserialize, ToSchema)] #[derive(Deserialize, ToSchema)]
@@ -160,7 +160,7 @@ pub(crate) async fn set_visibility(
.await .await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
crate::reindex(&state, object_id).await; reindex(&state, object_id).await;
Ok(StatusCode::NO_CONTENT) Ok(StatusCode::NO_CONTENT)
} }
+5 -5
View File
@@ -13,7 +13,7 @@ use domain::{AuditActor, CatalogueObject, ObjectId, ObjectInput, Visibility};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use utoipa::ToSchema; use utoipa::ToSchema;
use crate::{AppState, pagination::Pagination}; use crate::{AppState, pagination::Pagination, reindex};
/// A localized label `{ lang, label }` (shared across admin views). /// A localized label `{ lang, label }` (shared across admin views).
#[derive(Serialize, ToSchema)] #[derive(Serialize, ToSchema)]
@@ -234,7 +234,7 @@ pub(crate) async fn create_object(
.await .await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
crate::reindex(&state, id).await; reindex(&state, id).await;
Ok(( Ok((
StatusCode::CREATED, StatusCode::CREATED,
@@ -301,7 +301,7 @@ pub(crate) async fn update_object(
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
if existed { if existed {
crate::reindex(&state, object_id).await; reindex(&state, object_id).await;
Ok(StatusCode::NO_CONTENT) Ok(StatusCode::NO_CONTENT)
} else { } else {
@@ -343,7 +343,7 @@ pub(crate) async fn delete_object(
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
if existed { if existed {
crate::reindex(&state, object_id).await; reindex(&state, object_id).await;
Ok(StatusCode::NO_CONTENT) Ok(StatusCode::NO_CONTENT)
} else { } else {
@@ -449,7 +449,7 @@ pub(crate) async fn set_fields(
.await .await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
crate::reindex(&state, object_id).await; reindex(&state, object_id).await;
Ok(StatusCode::NO_CONTENT) Ok(StatusCode::NO_CONTENT)
} }