diff --git a/backend/src/v1/complaint/complaint.service.ts b/backend/src/v1/complaint/complaint.service.ts index af0be3b67..fbfaee64d 100644 --- a/backend/src/v1/complaint/complaint.service.ts +++ b/backend/src/v1/complaint/complaint.service.ts @@ -1000,7 +1000,6 @@ export class ComplaintService { token?: string, ): Promise => { try { - this.logger.error("Searching for complaints"); let results: SearchResults = { totalCount: 0, complaints: [] }; const { orderBy, sortBy, page, pageSize, query, ...filters } = model; diff --git a/frontend/src/app/components/containers/complaints/complaint-list.tsx b/frontend/src/app/components/containers/complaints/complaint-list.tsx index e7558252f..ab853540c 100644 --- a/frontend/src/app/components/containers/complaints/complaint-list.tsx +++ b/frontend/src/app/components/containers/complaints/complaint-list.tsx @@ -1,4 +1,4 @@ -import { FC, useRef, useState, useContext, useEffect } from "react"; +import { FC, useRef, useState, useContext, useEffect, useCallback } from "react"; import { useAppDispatch, useAppSelector } from "@hooks/hooks"; import COMPLAINT_TYPES from "@apptypes/app/complaint-types"; import { @@ -173,10 +173,10 @@ export const ComplaintList: FC = ({ type, searchQuery }) => { } }; - const handlePageChange = (page: number) => { + const handlePageChange = useCallback((page: number) => { setPage(page); scrollToTop(); - }; + }, []); // Scroll to top of table container when paginating const divRef = useRef(null);