This commit is contained in:
Rama Priyanto 2025-05-26 08:04:44 +07:00
commit 2c753104f6
1 changed files with 3 additions and 8 deletions

View File

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