feat: update public url for article in landing

This commit is contained in:
hanif salafi 2025-05-26 01:12:17 +07:00
parent 496dffe7e6
commit 05fcb88efd
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", "content-type": "application/json",
}; };
return await httpGet( 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 isPublish === undefined ? "" : isPublish
}&title=${search}&startDate=${startDate || ""}&endDate=${ }&title=${search}&startDate=${startDate || ""}&endDate=${
endDate || "" endDate || ""
@ -80,17 +80,12 @@ export async function getListArticleAdminPage(props: PaginationRequest) {
export async function getTopArticles(props: PaginationRequest) { export async function getTopArticles(props: PaginationRequest) {
const { page, limit, search, startDate, endDate, isPublish, category } = const { page, limit, search, startDate, endDate, isPublish, category } =
props; props;
const headers = { return await httpGetInterceptor(
"content-type": "application/json",
Authorization: `Bearer ${token}`,
};
return await httpGet(
`/articles?sort=desc&sortBy=created_at&limit=${limit}&page=${page}&isPublish=${ `/articles?sort=desc&sortBy=created_at&limit=${limit}&page=${page}&isPublish=${
isPublish === undefined ? "" : isPublish isPublish === undefined ? "" : isPublish
}&title=${search}&startDate=${startDate || ""}&endDate=${ }&title=${search}&startDate=${startDate || ""}&endDate=${
endDate || "" endDate || ""
}&category=${category || ""}&sortBy=view_count&sort=desc`, }&category=${category || ""}&sortBy=view_count&sort=desc`
headers
); );
} }