Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

added useResetPageHelper

x032205c18961c058c8
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountsTable.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountsTable.tsx
index 63a347961d..d45f89a90d 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountsTable.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountsTable.tsx
@@ -46,7 +46,7 @@ import {
PreferenceKey,
setUserTablePreference
} from "@app/helpers/userTablePreferences";
-import { usePagination, usePopUp } from "@app/hooks";
+import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
import { OrderByDirection } from "@app/hooks/api/generic/types";
import {
PAM_RESOURCE_TYPE_MAP,
@@ -148,6 +148,12 @@ export const PamAccountsTable = ({ projectId }: Props) => {
const folderPaths = data?.folderPaths || {};
const currentFolderId = data?.folderId ?? null;
+ useResetPageHelper({
+ totalCount,
+ offset,
+ setPage
+ });
+
const foldersToRender = useMemo(() => {
if (accountView === PamAccountView.Flat) {
return [];
diff --git a/frontend/src/pages/pam/PamResourcesPage/components/PamResourcesTable.tsx b/frontend/src/pages/pam/PamResourcesPage/components/PamResourcesTable.tsx
index 4e550a81f8..14f08ccad8 100644
--- a/frontend/src/pages/pam/PamResourcesPage/components/PamResourcesTable.tsx
+++ b/frontend/src/pages/pam/PamResourcesPage/components/PamResourcesTable.tsx
@@ -45,7 +45,7 @@ import {
PreferenceKey,
setUserTablePreference
} from "@app/helpers/userTablePreferences";
-import { usePagination, usePopUp } from "@app/hooks";
+import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
import { OrderByDirection } from "@app/hooks/api/generic/types";
import {
PAM_RESOURCE_TYPE_MAP,
@@ -121,6 +121,12 @@ export const PamResourcesTable = ({ projectId }: Props) => {
const resources = data?.resources || [];
const totalCount = data?.totalCount || 0;
+ useResetPageHelper({
+ totalCount,
+ offset,
+ setPage
+ });
+
const filteredResources = useMemo(
() =>
resources.filter((resource) => {