mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 03:31:27 +00:00
feature: server-side pagination/filtering/sorting for secrets overview and main pages
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
import { apiRequest } from "@app/config/request";
|
||||
import { dashboardKeys } from "@app/hooks/api/dashboard/queries";
|
||||
|
||||
import { dynamicSecretKeys } from "./queries";
|
||||
import {
|
||||
@@ -22,6 +23,8 @@ export const useCreateDynamicSecret = () => {
|
||||
return data.dynamicSecret;
|
||||
},
|
||||
onSuccess: (_, { path, environmentSlug, projectSlug }) => {
|
||||
// TODO: optimize but we currently don't pass projectId
|
||||
queryClient.invalidateQueries(dashboardKeys.all());
|
||||
queryClient.invalidateQueries(dynamicSecretKeys.list({ path, projectSlug, environmentSlug }));
|
||||
}
|
||||
});
|
||||
@@ -39,6 +42,8 @@ export const useUpdateDynamicSecret = () => {
|
||||
return data.dynamicSecret;
|
||||
},
|
||||
onSuccess: (_, { path, environmentSlug, projectSlug }) => {
|
||||
// TODO: optimize but currently don't pass projectId
|
||||
queryClient.invalidateQueries(dashboardKeys.all());
|
||||
queryClient.invalidateQueries(dynamicSecretKeys.list({ path, projectSlug, environmentSlug }));
|
||||
}
|
||||
});
|
||||
@@ -56,6 +61,8 @@ export const useDeleteDynamicSecret = () => {
|
||||
return data.dynamicSecret;
|
||||
},
|
||||
onSuccess: (_, { path, environmentSlug, projectSlug }) => {
|
||||
// TODO: optimize but currently don't pass projectId
|
||||
queryClient.invalidateQueries(dashboardKeys.all());
|
||||
queryClient.invalidateQueries(dynamicSecretKeys.list({ path, projectSlug, environmentSlug }));
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user