fix:article get

This commit is contained in:
Rama Priyanto 2026-02-12 11:32:52 +07:00
parent 24f6d18e44
commit 75e6981df0
1 changed files with 14 additions and 15 deletions

View File

@ -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,
);
}