Skip to content
Snippets Groups Projects
Commit 444b9daa authored by Domonkos Gulyas's avatar Domonkos Gulyas
Browse files

CE-2151: Make Record table links clickable

parent 8e5a4950
No related branches found
No related tags found
2 merge requests!407CE-2141: 3.0.0,!386CE-2151: Make Record table links clickable
......@@ -52,6 +52,7 @@ export const usePagination = ({
return {
pagination,
setPagination
setPagination,
setTotalCount
};
};
......@@ -98,7 +98,7 @@ export function RecordListView() {
const rowsPerPage = [20, 50];
const { pagination, setPagination } = usePagination({
const { pagination, setPagination, setTotalCount } = usePagination({
rowsPerPageOptions: rowsPerPage,
initLimit: urlPagination.rows ?? rowsPerPage[0],
initPage: urlPagination.page ?? 0
......@@ -106,8 +106,14 @@ export function RecordListView() {
// update pagination whenever search result total pages change
useEffect(() => {
setPagination({ totalCount: records?.totalCount ?? 0 });
}, [setPagination, records?.totalCount]);
setTotalCount((prev) => {
if (prev === pagination.totalCount && prev > 0) {
return prev;
} else {
return records?.totalCount ?? 0;
}
});
}, [pagination, records?.totalCount, setTotalCount]);
// whenever url state changes, update pagination
useEffect(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment