From bc5965ddce004c41f0b0636a4dde6e0dba40e3b6 Mon Sep 17 00:00:00 2001 From: mitya Date: Thu, 12 Dec 2024 18:49:07 +0100 Subject: [PATCH] get -> delete, return empty string json --- src/http/routers/v1.rs | 3 ++- src/http/routers/v1/v1_integrations.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/http/routers/v1.rs b/src/http/routers/v1.rs index 1cca1e7fa..7e7027573 100644 --- a/src/http/routers/v1.rs +++ b/src/http/routers/v1.rs @@ -3,6 +3,7 @@ use axum::Extension; use axum::Router; use axum::routing::get; use axum::routing::post; +use axum::routing::delete; use futures::Future; use hyper::Body; use hyper::Response; @@ -128,7 +129,7 @@ pub fn make_v1_router() -> Router { .route("/integrations-filtered/:integr_name", get(handle_v1_integrations_filtered)) .route("/integration-get", telemetry_post!(handle_v1_integration_get)) .route("/integration-save", telemetry_post!(handle_v1_integration_save)) - .route("/integration-delete", get(handle_v1_integration_delete)) + .route("/integration-delete", delete(handle_v1_integration_delete)) .route("/integration-icon/:icon_name", get(handle_v1_integration_icon)) .route("/docker-container-list", telemetry_post!(handle_v1_docker_container_list)) diff --git a/src/http/routers/v1/v1_integrations.rs b/src/http/routers/v1/v1_integrations.rs index 35ce6462d..455f3c973 100644 --- a/src/http/routers/v1/v1_integrations.rs +++ b/src/http/routers/v1/v1_integrations.rs @@ -176,6 +176,7 @@ pub async fn handle_v1_integration_delete( Ok(Response::builder() .status(StatusCode::OK) - .body(Body::from(format!("File {} deleted ", integration_path))) + .header("Content-Type", "application/json") + .body(Body::from(format!(""))) .unwrap()) }