Renamed filter to dateRange, add incidents table

This commit is contained in:
Alex Holliday committed 2024-08-08 16:13:08 -07:00
1 parent 60996da401
commit d95fcb119d
7 files changed
+285 -113

No files matched your search

@@ -15,7 +15,7 @@ import { useSelector } from "react-redux";
import axiosInstance from "../../../../Utils/axiosConfig";
import { StatusLabel } from "../../../../Components/Label";
const PaginationTable = ({ monitorId, filter }) => {
const PaginationTable = ({ monitorId, dateRange }) => {
const { authToken } = useSelector((state) => state.auth);
const [checks, setChecks] = useState([]);
const [checksCount, setChecksCount] = useState(0);
@@ -28,7 +28,7 @@ const PaginationTable = ({ monitorId, filter }) => {
const fetchPage = async () => {
try {
const res = await axiosInstance.get(
`/checks/${monitorId}?sortOrder=desc&filter=${filter}&page=${paginationController.page}&rowsPerPage=${paginationController.rowsPerPage}`,
`/checks/${monitorId}?sortOrder=desc&dateRange=${dateRange}&page=${paginationController.page}&rowsPerPage=${paginationController.rowsPerPage}`,
{
headers: {
Authorization: `Bearer ${authToken}`,
@@ -45,7 +45,7 @@ const PaginationTable = ({ monitorId, filter }) => {
}, [
authToken,
monitorId,
filter,
dateRange,
paginationController.page,
paginationController.rowsPerPage,
]);
@@ -115,7 +115,7 @@ const PaginationTable = ({ monitorId, filter }) => {
PaginationTable.propTypes = {
monitorId: PropTypes.string.isRequired,
filter: PropTypes.string.isRequired,
dateRange: PropTypes.string.isRequired,
};
export default PaginationTable;