fix pagination info for all tanstak-tables
This commit is contained in:
@@ -211,7 +211,6 @@ export async function fetchViolationAnalyticStatistic(group: 'domain' | 'tld') {
|
||||
|
||||
export async function fetchViolationStatistic(id: string) {
|
||||
const token = await getSessionData('token');
|
||||
console.log(`fileId => ${id}`)
|
||||
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
||||
@@ -232,7 +231,6 @@ export async function fetchViolationStatistic(id: string) {
|
||||
|
||||
if (response.ok) {
|
||||
let parsed = await response.json();
|
||||
console.log(parsed);
|
||||
|
||||
if (parsed?.message_body) {
|
||||
return parsed?.message_body;
|
||||
|
||||
@@ -1014,7 +1014,7 @@ export default function TanstakFilesTable({ fileType, showFileLink }: { fileType
|
||||
{t('page')}{' '}
|
||||
<strong>
|
||||
{pagination.pageIndex + 1} {t('out-of')} {totalPages || 1}
|
||||
</strong>
|
||||
</strong> | {t('total-files')}: {totalItems}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ export default function FilePageViolationsList({
|
||||
className="sources-list-pagination"
|
||||
>
|
||||
<span>
|
||||
{t('total-violations')}: {fileViolations?.total_elements} | {t('page')} {fileViolations?.current_page} {t('out-of')} {fileViolations?.total_pages}
|
||||
{t('page')} <strong>{fileViolations?.current_page + 1} {t('out-of')} {fileViolations?.total_pages}</strong> | {t('total-violations')}: {fileViolations?.total_elements}
|
||||
</span>
|
||||
{fileViolations?.total_pages > 1 && (
|
||||
<div className="pagination-controls">
|
||||
|
||||
@@ -47,6 +47,7 @@ export function TrackingHistoryView() {
|
||||
refetch
|
||||
} = useHistoryView(pagination.pageIndex, pagination.pageSize, locale, getSortParams.sortOrder, getSortParams.sortBy);
|
||||
|
||||
const totalElements = apiResponse?.totalElements || 0
|
||||
const tableData = apiResponse?.history || [];
|
||||
const totalPages = apiResponse?.totalPages || 0;
|
||||
|
||||
@@ -381,7 +382,7 @@ export function TrackingHistoryView() {
|
||||
{t('page')}{' '}
|
||||
<strong>
|
||||
{pagination.pageIndex + 1} {t('out-of')} {totalPages || 1}
|
||||
</strong>
|
||||
</strong> | {t('total-document-openings')}: {totalElements}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ export function ViolationsMyClaimsTable() {
|
||||
{t('page')}{' '}
|
||||
<strong>
|
||||
{pagination.pageIndex + 1} {t('out-of')} {totalPages || 1}
|
||||
</strong>
|
||||
</strong> | {t('total-claims')}: {totalItems}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ export function ViolationsMyComplaintsTable() {
|
||||
{t('page')}{' '}
|
||||
<strong>
|
||||
{pagination.pageIndex + 1} {t('out-of')} {totalPages || 1}
|
||||
</strong>
|
||||
</strong> | {t('total-complaints')}: {totalItems}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -477,7 +477,7 @@ export default function ViolationsTable() {
|
||||
{t('page')}{' '}
|
||||
<strong>
|
||||
{table.getState().pagination.pageIndex + 1} {t('out-of')} {violationData?.totalPages || 1}
|
||||
</strong>
|
||||
</strong> | {t('total-matches')}: {violationData?.totalElements}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user