From 75e6981df0eef0fd347833b321d8555fdd9c7155 Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Thu, 12 Feb 2026 11:32:52 +0700 Subject: [PATCH] fix:article get --- services/article.ts | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/services/article.ts b/services/article.ts index 4e612da..5e0f4f1 100644 --- a/services/article.ts +++ b/services/article.ts @@ -43,7 +43,7 @@ export async function getListArticle(props: PaginationRequest) { }&category=${categorySlug || ""}&isBanner=${isBanner || ""}&categoryIds=${ categoryIds || "" }&createdByIds=${createdByIds || ""}&isPolda=${isPolda || ""}`, - headers + headers, ); } @@ -65,9 +65,8 @@ export async function getListArticleAdminPage(props: PaginationRequest) { } = props; const headers = { "content-type": "application/json", - Authorization: `Bearer ${token}`, }; - return await httpGet( + return await httpGetInterceptor( `/articles?limit=${limit}&page=${page}&isPublish=${ isPublish === undefined ? "" : isPublish }&title=${search}&startDate=${startDate || ""}&endDate=${ @@ -77,7 +76,7 @@ export async function getListArticleAdminPage(props: PaginationRequest) { }&category=${categorySlug || ""}&isBanner=${isBanner || ""}&categoryIds=${ categoryIds || "" }&createdByIds=${createdByIds || ""}`, - headers + headers, ); } @@ -93,7 +92,7 @@ export async function getTopArticles(props: PaginationRequest) { }&title=${search}&startDate=${startDate || ""}&endDate=${ endDate || "" }&category=${category || ""}&sortBy=view_count&sort=desc`, - headers + headers, ); } @@ -136,7 +135,7 @@ export async function getRecapArticleData(data: any) { }; return await httpGet( `/articles?page=${data.page}&userLevelId=${data.id}&startDate=${data.startDate}&endDate=${data.endDate}&startTime=${data.startTime}&endTime=${data.endTime}`, - headers + headers, ); } @@ -169,7 +168,7 @@ export async function getCategoryPagination(data: any) { return await httpGet( `/article-categories?limit=${data?.limit}&page=${data?.page}&title=${data?.search}`, - headers + headers, ); } @@ -208,7 +207,7 @@ export async function getUserLevelDataStat( startTime: string, endTime: string, levelType: string, - levelId?: number + levelId?: number, ) { // const headers = { // "content-type": "application/json", @@ -217,7 +216,7 @@ export async function getUserLevelDataStat( return await httpGetInterceptor( `/articles/statistic/user-levels?startDate=${startDate}&endDate=${endDate}&startTime=${startTime}&endTime=${endTime}&levelType=${levelType}&userLevelId=${ levelId || "" - }` + }`, ); } @@ -228,13 +227,13 @@ export async function getStatisticForMaps(startDate: string, endDate: string) { }; return await httpGet( `/activity-logs/visitors-by-region-stats?startDate=${startDate}&endDate=${endDate}`, - headers + headers, ); } export async function getStatisticVisitorsBrowser( startDate: string, - endDate: string + endDate: string, ) { const headers = { "content-type": "application/json", @@ -242,7 +241,7 @@ export async function getStatisticVisitorsBrowser( }; return await httpGet( `/activity-logs/visitors-by-browser-stats?startDate=${startDate}&endDate=${endDate}`, - headers + headers, ); } export async function getStatisticMonthly(year: string) { @@ -259,7 +258,7 @@ export async function getStatisticVisitorsMonthly(year: string) { }; return await httpGet( `/activity-logs/visitors-monthly-stats?year=${year}`, - headers + headers, ); } export async function getStatisticUsersMonthly(year: string) { @@ -269,7 +268,7 @@ export async function getStatisticUsersMonthly(year: string) { }; return await httpGet( `/articles/statistic/monthly-per-user-level?year=${year}`, - headers + headers, ); } export async function getStatisticMonthlyFeedback(year: string) { @@ -317,6 +316,6 @@ export async function getArticleByCategoryLanding(props: { }; return await httpGet( `/article-categories?limit=${props.limit}&title=${props.title}`, - headers + headers, ); }