From 8f9a32948feb7e55ed5780d0cf65c404c8cce0b4 Mon Sep 17 00:00:00 2001 From: SquidSpirit Date: Sat, 2 Aug 2025 10:32:36 +0800 Subject: [PATCH] BLOG-105 fix: update post endpoint to remove '/all' from the path for consistency --- .../feature/post/src/framework/web/get_all_post_info_handler.rs | 2 +- backend/feature/post/src/framework/web/post_web_routes.rs | 2 +- frontend/src/lib/post/framework/api/postApiServiceImpl.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/feature/post/src/framework/web/get_all_post_info_handler.rs b/backend/feature/post/src/framework/web/get_all_post_info_handler.rs index f0e34ca..a47669d 100644 --- a/backend/feature/post/src/framework/web/get_all_post_info_handler.rs +++ b/backend/feature/post/src/framework/web/get_all_post_info_handler.rs @@ -7,7 +7,7 @@ use crate::adapter::delivery::{ #[utoipa::path( get, - path = "/post/all", + path = "/post", tag = "post", summary = "Get all post information", params( diff --git a/backend/feature/post/src/framework/web/post_web_routes.rs b/backend/feature/post/src/framework/web/post_web_routes.rs index 610c697..a42d4ac 100644 --- a/backend/feature/post/src/framework/web/post_web_routes.rs +++ b/backend/feature/post/src/framework/web/post_web_routes.rs @@ -9,7 +9,7 @@ use crate::framework::web::{ pub fn configure_post_routes(cfg: &mut web::ServiceConfig) { cfg.service( web::scope("/post") - .route("/all", web::get().to(get_all_post_info_handler)) + .route("", web::get().to(get_all_post_info_handler)) .route("/{id}", web::get().to(get_post_by_id_handler)), ); diff --git a/frontend/src/lib/post/framework/api/postApiServiceImpl.ts b/frontend/src/lib/post/framework/api/postApiServiceImpl.ts index 61e1328..6ede11e 100644 --- a/frontend/src/lib/post/framework/api/postApiServiceImpl.ts +++ b/frontend/src/lib/post/framework/api/postApiServiceImpl.ts @@ -7,7 +7,7 @@ export class PostApiServiceImpl implements PostApiService { constructor(private fetchFn: typeof fetch) {} async getAllPosts(): Promise { - const url = new URL('post/all', Environment.API_BASE_URL); + const url = new URL('post', Environment.API_BASE_URL); const response = await this.fetchFn(url.href);