BLOG-105 Implement CRUD functionality for Labels #107
@ -7,7 +7,7 @@ use crate::adapter::delivery::{
|
|||||||
|
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
get,
|
get,
|
||||||
path = "/post/all",
|
path = "/post",
|
||||||
tag = "post",
|
tag = "post",
|
||||||
summary = "Get all post information",
|
summary = "Get all post information",
|
||||||
params(
|
params(
|
||||||
|
@ -9,7 +9,7 @@ use crate::framework::web::{
|
|||||||
pub fn configure_post_routes(cfg: &mut web::ServiceConfig) {
|
pub fn configure_post_routes(cfg: &mut web::ServiceConfig) {
|
||||||
cfg.service(
|
cfg.service(
|
||||||
web::scope("/post")
|
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)),
|
.route("/{id}", web::get().to(get_post_by_id_handler)),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ export class PostApiServiceImpl implements PostApiService {
|
|||||||
constructor(private fetchFn: typeof fetch) {}
|
constructor(private fetchFn: typeof fetch) {}
|
||||||
|
|
||||||
async getAllPosts(): Promise<PostInfoResponseDto[]> {
|
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);
|
const response = await this.fetchFn(url.href);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user