feature: secret overview page pagination/optimizations

This commit is contained in:
Scott Wilson
2024-09-12 21:44:38 -07:00
parent 088e888560
commit a5f5f803df
4 changed files with 166 additions and 78 deletions
@@ -160,10 +160,9 @@ export const useGetImportedSecretsAllEnvs = ({
projectId,
path
}),
queryFn: () => fetchImportedSecrets(projectId, env, path).catch(() => []),
enabled: Boolean(projectId) && Boolean(env),
// eslint-disable-next-line react-hooks/rules-of-hooks
select: (data: TImportedSecrets[]) => {
queryFn: async () => {
const data = await fetchImportedSecrets(projectId, env, path).catch(() => []);
return data.map((el) => ({
environment: el.environment,
secretPath: el.secretPath,
@@ -183,7 +182,8 @@ export const useGetImportedSecretsAllEnvs = ({
};
})
}));
}
},
enabled: Boolean(projectId) && Boolean(env)
}))
});