From 53ef84f4dc8582bd737c691881093e6808db2828 Mon Sep 17 00:00:00 2001 From: Tamo Date: Mon, 7 Oct 2024 15:10:59 +0200 Subject: [PATCH] add the error message for the task deletion and task cancellation when no filter are sent --- meilisearch/src/routes/tasks.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/meilisearch/src/routes/tasks.rs b/meilisearch/src/routes/tasks.rs index 3134bb852..b5d30aaff 100644 --- a/meilisearch/src/routes/tasks.rs +++ b/meilisearch/src/routes/tasks.rs @@ -247,6 +247,14 @@ impl TaskDeletionOrCancelationQuery { "enqueuedAt": "2024-08-08T17:05:55.791772Z" } )), + (status = 400, description = "A filter is missing", body = ResponseError, content_type = "application/json", example = json!( + { + "message": "Query parameters to filter the tasks to cancel are missing. Available query parameters are: `uids`, `indexUids`, `statuses`, `types`, `canceledBy`, `beforeEnqueuedAt`, `afterEnqueuedAt`, `beforeStartedAt`, `afterStartedAt`, `beforeFinishedAt`, `afterFinishedAt`.", + "code": "missing_task_filters", + "type": "invalid_request", + "link": "https://docs.meilisearch.com/errors#missing_task_filters" + } + )), (status = 401, description = "The authorization header is missing", body = ResponseError, content_type = "application/json", example = json!( { "message": "The Authorization header is missing. It must use the bearer authorization method.", @@ -335,6 +343,14 @@ async fn cancel_tasks( "enqueuedAt": "2024-08-08T17:05:55.791772Z" } )), + (status = 400, description = "A filter is missing", body = ResponseError, content_type = "application/json", example = json!( + { + "message": "Query parameters to filter the tasks to delete are missing. Available query parameters are: `uids`, `indexUids`, `statuses`, `types`, `canceledBy`, `beforeEnqueuedAt`, `afterEnqueuedAt`, `beforeStartedAt`, `afterStartedAt`, `beforeFinishedAt`, `afterFinishedAt`.", + "code": "missing_task_filters", + "type": "invalid_request", + "link": "https://docs.meilisearch.com/errors#missing_task_filters" + } + )), (status = 401, description = "The authorization header is missing", body = ResponseError, content_type = "application/json", example = json!( { "message": "The Authorization header is missing. It must use the bearer authorization method.",