diff --git a/components/main/dashboard/dashboard-container.tsx b/components/main/dashboard/dashboard-container.tsx index eeb8575..f3a6561 100644 --- a/components/main/dashboard/dashboard-container.tsx +++ b/components/main/dashboard/dashboard-container.tsx @@ -130,6 +130,7 @@ export default function DashboardContainer() { page: topPagespage, search: "", sort: "desc", + isPublish: true, }; const res = await getTopArticles(req); setTopPages(getTableNumber(10, res.data?.data)); @@ -154,7 +155,7 @@ export default function DashboardContainer() { const getTableNumber = (limit: number, data: any) => { if (data) { - const startIndex = limit * (page - 1); + const startIndex = limit * (topPagespage - 1); let iterate = 0; const newData = data.map((value: any) => { iterate++; diff --git a/components/table/article-table.tsx b/components/table/article-table.tsx index db85933..478f653 100644 --- a/components/table/article-table.tsx +++ b/components/table/article-table.tsx @@ -199,7 +199,6 @@ export default function ArticleTable() { async function initState() { loading(); - console.log("test", getIds(selectedCategories)); const req = { limit: showData, page: page, @@ -535,7 +534,7 @@ export default function ArticleTable() { isClearable={true} isSearchable={true} isMulti={true} - placeholder="Kategori..." + placeholder="Author..." name="sub-module" options={users} /> diff --git a/services/article.ts b/services/article.ts index 4740218..68ee101 100644 --- a/services/article.ts +++ b/services/article.ts @@ -77,7 +77,7 @@ export async function getTopArticles(props: PaginationRequest) { const { page, limit, search, startDate, endDate, isPublish, category } = props; return await httpGetInterceptor( - `/articles?sort=desc&sortBy=created_at&limit=${limit}&page=${page}&isPublish=${ + `/articles?limit=${limit}&page=${page}&isPublish=${ isPublish === undefined ? "" : isPublish }&title=${search}&startDate=${startDate || ""}&endDate=${ endDate || ""