BLOG-105 fix: update post endpoint to remove '/all' from the path for consistency
This commit is contained in:
parent
646b2db73b
commit
8f9a32948f
@ -7,7 +7,7 @@ use crate::adapter::delivery::{
|
||||
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/post/all",
|
||||
path = "/post",
|
||||
tag = "post",
|
||||
summary = "Get all post information",
|
||||
params(
|
||||
|
@ -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)),
|
||||
);
|
||||
|
||||
|
@ -7,7 +7,7 @@ export class PostApiServiceImpl implements PostApiService {
|
||||
constructor(private fetchFn: typeof fetch) {}
|
||||
|
||||
async getAllPosts(): Promise<PostInfoResponseDto[]> {
|
||||
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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user