Restore http code issues

This commit is contained in:
Mubelotix
2025-08-12 19:07:11 +02:00
parent 1f7689a3fb
commit ae73465eab
2 changed files with 9 additions and 6 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 = ACCEPTED, description = "Export successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = OK, description = "Export successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 1, "taskUid": 1,
"status": "enqueued", "status": "enqueued",
@ -106,7 +106,8 @@ async fn export(
analytics.publish(analytics_aggregate, &req); analytics.publish(analytics_aggregate, &req);
Ok(HttpResponse::Accepted().json(task)) // FIXME: This should be 202 Accepted, but changing would be breaking so we need to wait 2.0
Ok(HttpResponse::Ok().json(task))
} }
#[derive(Debug, Deserr, ToSchema, Serialize)] #[derive(Debug, Deserr, ToSchema, Serialize)]

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 = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = OK, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": null, "indexUid": null,
@ -392,7 +392,8 @@ async fn cancel_tasks(
.await??; .await??;
let task: SummarizedTaskView = task.into(); let task: SummarizedTaskView = task.into();
Ok(HttpResponse::Accepted().json(task)) // FIXME: This should be 202 Accepted, but changing would be breaking so we need to wait 2.0
Ok(HttpResponse::Ok().json(task))
} }
/// Delete tasks /// Delete tasks
@ -405,7 +406,7 @@ async fn cancel_tasks(
security(("Bearer" = ["tasks.delete", "tasks.*", "*"])), security(("Bearer" = ["tasks.delete", "tasks.*", "*"])),
params(TaskDeletionOrCancelationQuery), params(TaskDeletionOrCancelationQuery),
responses( responses(
(status = ACCEPTED, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( (status = OK, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!(
{ {
"taskUid": 147, "taskUid": 147,
"indexUid": null, "indexUid": null,
@ -485,7 +486,8 @@ async fn delete_tasks(
.await??; .await??;
let task: SummarizedTaskView = task.into(); let task: SummarizedTaskView = task.into();
Ok(HttpResponse::Accepted().json(task)) // FIXME: This should be 202 Accepted, but changing would be breaking so we need to wait 2.0
Ok(HttpResponse::Ok().json(task))
} }
#[derive(Debug, Serialize, ToSchema)] #[derive(Debug, Serialize, ToSchema)]