diff --git a/src/components/RequestList/index.tsx b/src/components/RequestList/index.tsx index 7af6807fc..d0177e641 100644 --- a/src/components/RequestList/index.tsx +++ b/src/components/RequestList/index.tsx @@ -4,6 +4,7 @@ import React, { useEffect, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import useSWR from 'swr'; import type { RequestResultsResponse } from '../../../server/interfaces/api/requestInterfaces'; +import { useUpdateQueryParams } from '../../hooks/useUpdateQueryParams'; import { useUser } from '../../hooks/useUser'; import globalMessages from '../../i18n/globalMessages'; import Button from '../Common/Button'; @@ -42,6 +43,7 @@ const RequestList: React.FC = () => { const page = router.query.page ? Number(router.query.page) : 1; const pageIndex = page - 1; + const updateQueryParams = useUpdateQueryParams({ page: page.toString() }); const { data, error, revalidate } = useSWR( `/api/v1/request?take=${currentPageSize}&skip=${ @@ -284,43 +286,13 @@ const RequestList: React.FC = () => {
diff --git a/src/components/Settings/SettingsLogs/index.tsx b/src/components/Settings/SettingsLogs/index.tsx index e8bfd4a5a..055eebb29 100644 --- a/src/components/Settings/SettingsLogs/index.tsx +++ b/src/components/Settings/SettingsLogs/index.tsx @@ -8,6 +8,7 @@ import { LogMessage, LogsResultsResponse, } from '../../../../server/interfaces/api/settingsInterfaces'; +import { useUpdateQueryParams } from '../../../hooks/useUpdateQueryParams'; import globalMessages from '../../../i18n/globalMessages'; import Error from '../../../pages/_error'; import Badge from '../../Common/Badge'; @@ -53,6 +54,7 @@ const SettingsLogs: React.FC = () => { const page = router.query.page ? Number(router.query.page) : 1; const pageIndex = page - 1; + const updateQueryParams = useUpdateQueryParams({ page: page.toString() }); const toggleLogs = () => { setRefreshInterval(refreshInterval === 5000 ? 0 : 5000); @@ -456,15 +458,7 @@ const SettingsLogs: React.FC = () => {