Change the route to get the task documents

This commit is contained in:
Kerollmops 2025-02-10 14:55:07 +01:00
parent 55fa2dda00
commit 491d115c3c
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -49,7 +49,8 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
.service(web::resource("/cancel").route(web::post().to(SeqHandler(cancel_tasks)))) .service(web::resource("/cancel").route(web::post().to(SeqHandler(cancel_tasks))))
.service(web::resource("/{task_id}").route(web::get().to(SeqHandler(get_task)))) .service(web::resource("/{task_id}").route(web::get().to(SeqHandler(get_task))))
.service( .service(
web::resource("/{task_id}/file").route(web::get().to(SeqHandler(get_task_update_file))), web::resource("/{task_id}/documents")
.route(web::get().to(SeqHandler(get_task_documents_file))),
); );
} }
@ -645,12 +646,12 @@ async fn get_task(
} }
} }
/// Get a task's update file. /// Get a task's documents.
/// ///
/// Get a [task's file](https://www.meilisearch.com/docs/learn/async/asynchronous_operations). /// Get a [task's documents file](https://www.meilisearch.com/docs/learn/async/asynchronous_operations).
#[utoipa::path( #[utoipa::path(
get, get,
path = "/{taskUid}/file", path = "/{taskUid}/documents",
tag = "Tasks", tag = "Tasks",
security(("Bearer" = ["tasks.get", "tasks.*", "*"])), security(("Bearer" = ["tasks.get", "tasks.*", "*"])),
params(("taskUid", format = UInt32, example = 0, description = "The task identifier", nullable = false)), params(("taskUid", format = UInt32, example = 0, description = "The task identifier", nullable = false)),
@ -674,7 +675,7 @@ async fn get_task(
)) ))
) )
)] )]
async fn get_task_update_file( async fn get_task_documents_file(
index_scheduler: GuardedData<ActionPolicy<{ actions::TASKS_GET }>, Data<IndexScheduler>>, index_scheduler: GuardedData<ActionPolicy<{ actions::TASKS_GET }>, Data<IndexScheduler>>,
task_uid: web::Path<String>, task_uid: web::Path<String>,
) -> Result<HttpResponse, ResponseError> { ) -> Result<HttpResponse, ResponseError> {