fix auth errors and add primigenial paper trash
This commit is contained in:
@@ -4,6 +4,7 @@ use axum::{
|
||||
Router,
|
||||
extract::{State, Query, Path},
|
||||
middleware,
|
||||
http::StatusCode,
|
||||
};
|
||||
use tower_http::{
|
||||
compression::CompressionLayer,
|
||||
@@ -18,10 +19,12 @@ use crate::application::services::folder_service::FolderService;
|
||||
use crate::application::services::file_service::FileService;
|
||||
use crate::application::services::i18n_application_service::I18nApplicationService;
|
||||
use crate::application::services::batch_operations::BatchOperationService;
|
||||
use crate::application::ports::trash_ports::TrashUseCase;
|
||||
|
||||
use crate::interfaces::api::handlers::folder_handler::FolderHandler;
|
||||
use crate::interfaces::api::handlers::file_handler::FileHandler;
|
||||
use crate::interfaces::api::handlers::i18n_handler::I18nHandler;
|
||||
use crate::interfaces::api::handlers::trash_handler;
|
||||
use crate::interfaces::api::handlers::batch_handler::{
|
||||
self, BatchHandlerState
|
||||
};
|
||||
@@ -32,7 +35,8 @@ pub fn create_api_routes(
|
||||
folder_service: Arc<FolderService>,
|
||||
file_service: Arc<FileService>,
|
||||
i18n_service: Option<Arc<I18nApplicationService>>,
|
||||
) -> Router<Arc<crate::common::di::AppState>> {
|
||||
trash_service: Option<Arc<dyn TrashUseCase>>,
|
||||
) -> Router<crate::common::di::AppState> {
|
||||
// Inicializar el servicio de operaciones por lotes
|
||||
let batch_service = Arc::new(BatchOperationService::default(
|
||||
file_service.clone(),
|
||||
@@ -123,6 +127,14 @@ pub fn create_api_routes(
|
||||
.nest("/folders", folders_router)
|
||||
.nest("/files", files_router)
|
||||
.nest("/batch", batch_router);
|
||||
|
||||
// Temporarily skip trash routes to fix the auth middleware issue
|
||||
// Once the auth middleware is fixed, we can re-enable these routes
|
||||
/*
|
||||
if let Some(_ts) = trash_service.clone() {
|
||||
// Trash routes are temporarily disabled
|
||||
}
|
||||
*/
|
||||
|
||||
// Add i18n routes if the service is provided
|
||||
if let Some(i18n_service) = i18n_service {
|
||||
|
||||
Reference in New Issue
Block a user