From 05fcb88efda60fb94f281542aab32119964cd081 Mon Sep 17 00:00:00 2001 From: hanif salafi Date: Mon, 26 May 2025 01:12:17 +0700 Subject: [PATCH] feat: update public url for article in landing --- services/article.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/services/article.ts b/services/article.ts index 373b762..f636d94 100644 --- a/services/article.ts +++ b/services/article.ts @@ -31,7 +31,7 @@ export async function getListArticle(props: PaginationRequest) { "content-type": "application/json", }; return await httpGet( - `/articles?sort=desc&sortBy=created_at&limit=${limit}&page=${page}&isPublish=${ + `/articles/public?sort=desc&sortBy=created_at&limit=${limit}&page=${page}&isPublish=${ isPublish === undefined ? "" : isPublish }&title=${search}&startDate=${startDate || ""}&endDate=${ endDate || "" @@ -80,17 +80,12 @@ export async function getListArticleAdminPage(props: PaginationRequest) { export async function getTopArticles(props: PaginationRequest) { const { page, limit, search, startDate, endDate, isPublish, category } = props; - const headers = { - "content-type": "application/json", - Authorization: `Bearer ${token}`, - }; - return await httpGet( + return await httpGetInterceptor( `/articles?sort=desc&sortBy=created_at&limit=${limit}&page=${page}&isPublish=${ isPublish === undefined ? "" : isPublish }&title=${search}&startDate=${startDate || ""}&endDate=${ endDate || "" - }&category=${category || ""}&sortBy=view_count&sort=desc`, - headers + }&category=${category || ""}&sortBy=view_count&sort=desc` ); }