From 800fad89ea56d553b29b43cd17b5da363bc7cb94 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 13 Aug 2025 11:42:13 -0300 Subject: [PATCH] fix: correct API path documentation and remove missing delete handler Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) --- src/modes/server/api/item.rs | 6 +++--- src/modes/server/api/mod.rs | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/modes/server/api/item.rs b/src/modes/server/api/item.rs index d7da66f..5887181 100644 --- a/src/modes/server/api/item.rs +++ b/src/modes/server/api/item.rs @@ -160,16 +160,16 @@ pub async fn handle_post_item( } #[utoipa::path( - delete, + get, path = "/api/item/{item_id}", responses( - (status = 200, description = "Successfully deleted item", body = ApiResponse<()>), + (status = 200, description = "Successfully retrieved item content", body = ApiResponse), (status = 401, description = "Unauthorized"), (status = 404, description = "Item not found"), (status = 500, description = "Internal server error") ), params( - ("item_id" = i64, Path, description = "ID of the item to delete") + ("item_id" = i64, Path, description = "ID of the item to retrieve") ), security( ("bearerAuth" = []) diff --git a/src/modes/server/api/mod.rs b/src/modes/server/api/mod.rs index 42114cf..93b5f6a 100644 --- a/src/modes/server/api/mod.rs +++ b/src/modes/server/api/mod.rs @@ -22,7 +22,6 @@ use utoipa_swagger_ui::SwaggerUi; item::handle_get_item, item::handle_get_item_meta, item::handle_get_item_content, - item::handle_delete_item, ), components( schemas( @@ -47,7 +46,7 @@ pub fn add_routes(router: Router) -> Router { .route("/api/item/latest", get(item::handle_get_item_latest)) .route("/api/item/latest/meta", get(item::handle_get_item_latest_meta)) .route("/api/item/latest/content", get(item::handle_get_item_latest_content)) - .route("/api/item/:item_id", get(item::handle_get_item).delete(item::handle_delete_item)) + .route("/api/item/:item_id", get(item::handle_get_item)) .route("/api/item/:item_id/meta", get(item::handle_get_item_meta)) .route("/api/item/:item_id/content", get(item::handle_get_item_content)) }