Added pagination resets

This commit is contained in:
Alex Holliday
2024-08-10 10:38:14 -07:00
parent ee84d8d93e
commit 573b9c2809
2 changed files with 14 additions and 0 deletions
@@ -28,6 +28,13 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
rowsPerPage: 12,
});
useEffect(() => {
setPaginationController({
...paginationController,
page: 0,
});
}, [filter, selectedMonitor]);
useEffect(() => {
const fetchPage = async () => {
if (!monitors || Object.keys(monitors).length === 0) {
@@ -27,6 +27,13 @@ const PaginationTable = ({ monitorId, dateRange }) => {
rowsPerPage: 5,
});
useEffect(() => {
setPaginationController({
...paginationController,
page: 0,
});
}, [dateRange]);
useEffect(() => {
const fetchPage = async () => {
try {