Fix many error code mistakes

This commit is contained in:
Mubelotix
2025-08-06 14:25:40 +02:00
parent 498b0b1419
commit 5309a37fb0
6 changed files with 19 additions and 19 deletions

View File

@ -47,7 +47,7 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
tag = "Export", tag = "Export",
security(("Bearer" = ["export", "*"])), security(("Bearer" = ["export", "*"])),
responses( responses(
(status = 202, description = "Export successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Export successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 1, "taskUid": 1,
"status": "enqueued", "status": "enqueued",
@ -106,7 +106,7 @@ async fn export(
analytics.publish(analytics_aggregate, &req); analytics.publish(analytics_aggregate, &req);
Ok(HttpResponse::Ok().json(task)) Ok(HttpResponse::Accepted().json(task))
} }
#[derive(Debug, Deserr, ToSchema, Serialize)] #[derive(Debug, Deserr, ToSchema, Serialize)]

View File

@ -306,7 +306,7 @@ impl Aggregate for DocumentsDeletionAggregator {
("documentId" = String, Path, example = "853", description = "Document Identifier", nullable = false), ("documentId" = String, Path, example = "853", description = "Document Identifier", nullable = false),
), ),
responses( responses(
(status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": null, "indexUid": null,
@ -423,7 +423,7 @@ pub struct BrowseQuery {
params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)),
request_body = BrowseQuery, request_body = BrowseQuery,
responses( responses(
(status = 200, description = "Task successfully enqueued", body = PaginationView<serde_json::Value>, content_type = "application/json", example = json!( (status = 200, description = "Documents returned", body = PaginationView<serde_json::Value>, content_type = "application/json", example = json!(
{ {
"results":[ "results":[
{ {
@ -733,7 +733,7 @@ impl<Method: AggregateMethod> Aggregate for DocumentsAggregator<Method> {
), ),
request_body = serde_json::Value, request_body = serde_json::Value,
responses( responses(
(status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": null, "indexUid": null,
@ -834,7 +834,7 @@ pub async fn replace_documents(
), ),
request_body = serde_json::Value, request_body = serde_json::Value,
responses( responses(
(status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": null, "indexUid": null,
@ -1100,7 +1100,7 @@ async fn copy_body_to_file(
), ),
request_body = Vec<Value>, request_body = Vec<Value>,
responses( responses(
(status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": null, "indexUid": null,
@ -1291,7 +1291,7 @@ impl Aggregate for EditDocumentsByFunctionAggregator {
), ),
request_body = DocumentEditionByFunction, request_body = DocumentEditionByFunction,
responses( responses(
(status = 202, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": null, "indexUid": null,
@ -1389,7 +1389,7 @@ pub async fn edit_documents_by_function(
security(("Bearer" = ["documents.delete", "documents.*", "*"])), security(("Bearer" = ["documents.delete", "documents.*", "*"])),
params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)),
responses( responses(
(status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": null, "indexUid": null,

View File

@ -231,7 +231,7 @@ impl Aggregate for IndexCreatedAggregate {
security(("Bearer" = ["indexes.create", "indexes.*", "*"])), security(("Bearer" = ["indexes.create", "indexes.*", "*"])),
request_body = IndexCreateRequest, request_body = IndexCreateRequest,
responses( responses(
(status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": "movies", "indexUid": "movies",

View File

@ -98,7 +98,7 @@ macro_rules! make_setting_route {
params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)),
request_body = $type, request_body = $type,
responses( responses(
(status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": "movies", "indexUid": "movies",
@ -162,7 +162,7 @@ macro_rules! make_setting_route {
params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)),
request_body = $type, request_body = $type,
responses( responses(
(status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": "movies", "indexUid": "movies",
@ -530,7 +530,7 @@ make_setting_routes!(
params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)),
request_body = Settings<Unchecked>, request_body = Settings<Unchecked>,
responses( responses(
(status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": "movies", "indexUid": "movies",
@ -680,7 +680,7 @@ pub async fn get_all(
security(("Bearer" = ["settings.update", "settings.*", "*"])), security(("Bearer" = ["settings.update", "settings.*", "*"])),
params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)),
responses( responses(
(status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": "movies", "indexUid": "movies",

View File

@ -68,7 +68,7 @@ impl Aggregate for IndexSwappedAnalytics {
security(("Bearer" = ["search", "*"])), security(("Bearer" = ["search", "*"])),
request_body = Vec<SwapIndexesPayload>, request_body = Vec<SwapIndexesPayload>,
responses( responses(
(status = OK, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 3, "taskUid": 3,
"indexUid": null, "indexUid": null,

View File

@ -311,7 +311,7 @@ impl<Method: AggregateMethod + 'static> Aggregate for TaskFilterAnalytics<Method
security(("Bearer" = ["tasks.cancel", "tasks.*", "*"])), security(("Bearer" = ["tasks.cancel", "tasks.*", "*"])),
params(TaskDeletionOrCancelationQuery), params(TaskDeletionOrCancelationQuery),
responses( responses(
(status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": null, "indexUid": null,
@ -392,7 +392,7 @@ async fn cancel_tasks(
.await??; .await??;
let task: SummarizedTaskView = task.into(); let task: SummarizedTaskView = task.into();
Ok(HttpResponse::Ok().json(task)) Ok(HttpResponse::Accepted().json(task))
} }
/// Delete tasks /// Delete tasks
@ -405,7 +405,7 @@ async fn cancel_tasks(
security(("Bearer" = ["tasks.delete", "tasks.*", "*"])), security(("Bearer" = ["tasks.delete", "tasks.*", "*"])),
params(TaskDeletionOrCancelationQuery), params(TaskDeletionOrCancelationQuery),
responses( responses(
(status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": null, "indexUid": null,
@ -485,7 +485,7 @@ async fn delete_tasks(
.await??; .await??;
let task: SummarizedTaskView = task.into(); let task: SummarizedTaskView = task.into();
Ok(HttpResponse::Ok().json(task)) Ok(HttpResponse::Accepted().json(task))
} }
#[derive(Debug, Serialize, ToSchema)] #[derive(Debug, Serialize, ToSchema)]