mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
added useResetPageHelper
This commit is contained in:
@@ -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 [];
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user