mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 06:28:11 +00:00
added useResetPageHelper
This commit is contained in:
@@ -46,7 +46,7 @@ import {
|
|||||||
PreferenceKey,
|
PreferenceKey,
|
||||||
setUserTablePreference
|
setUserTablePreference
|
||||||
} from "@app/helpers/userTablePreferences";
|
} 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 { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
import {
|
import {
|
||||||
PAM_RESOURCE_TYPE_MAP,
|
PAM_RESOURCE_TYPE_MAP,
|
||||||
@@ -148,6 +148,12 @@ export const PamAccountsTable = ({ projectId }: Props) => {
|
|||||||
const folderPaths = data?.folderPaths || {};
|
const folderPaths = data?.folderPaths || {};
|
||||||
const currentFolderId = data?.folderId ?? null;
|
const currentFolderId = data?.folderId ?? null;
|
||||||
|
|
||||||
|
useResetPageHelper({
|
||||||
|
totalCount,
|
||||||
|
offset,
|
||||||
|
setPage
|
||||||
|
});
|
||||||
|
|
||||||
const foldersToRender = useMemo(() => {
|
const foldersToRender = useMemo(() => {
|
||||||
if (accountView === PamAccountView.Flat) {
|
if (accountView === PamAccountView.Flat) {
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import {
|
|||||||
PreferenceKey,
|
PreferenceKey,
|
||||||
setUserTablePreference
|
setUserTablePreference
|
||||||
} from "@app/helpers/userTablePreferences";
|
} 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 { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
import {
|
import {
|
||||||
PAM_RESOURCE_TYPE_MAP,
|
PAM_RESOURCE_TYPE_MAP,
|
||||||
@@ -121,6 +121,12 @@ export const PamResourcesTable = ({ projectId }: Props) => {
|
|||||||
const resources = data?.resources || [];
|
const resources = data?.resources || [];
|
||||||
const totalCount = data?.totalCount || 0;
|
const totalCount = data?.totalCount || 0;
|
||||||
|
|
||||||
|
useResetPageHelper({
|
||||||
|
totalCount,
|
||||||
|
offset,
|
||||||
|
setPage
|
||||||
|
});
|
||||||
|
|
||||||
const filteredResources = useMemo(
|
const filteredResources = useMemo(
|
||||||
() =>
|
() =>
|
||||||
resources.filter((resource) => {
|
resources.filter((resource) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user