mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 22:46:24 +00:00
feat: renamed old frontend and fixed some minor bugs
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
export const useCreateDynamicSecret = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation<{}, {}, TCreateDynamicSecretDTO>({
|
||||
return useMutation<object, object, TCreateDynamicSecretDTO>({
|
||||
mutationFn: async (dto) => {
|
||||
const { data } = await apiRequest.post<{ dynamicSecret: TDynamicSecret }>(
|
||||
"/api/v1/dynamic-secrets",
|
||||
@@ -24,8 +24,10 @@ export const useCreateDynamicSecret = () => {
|
||||
},
|
||||
onSuccess: (_, { path, environmentSlug, projectSlug }) => {
|
||||
// TODO: optimize but we currently don't pass projectId
|
||||
queryClient.invalidateQueries(dashboardKeys.all());
|
||||
queryClient.invalidateQueries(dynamicSecretKeys.list({ path, projectSlug, environmentSlug }));
|
||||
queryClient.invalidateQueries({ queryKey: dashboardKeys.all() });
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: dynamicSecretKeys.list({ path, projectSlug, environmentSlug })
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -33,7 +35,7 @@ export const useCreateDynamicSecret = () => {
|
||||
export const useUpdateDynamicSecret = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation<{}, {}, TUpdateDynamicSecretDTO>({
|
||||
return useMutation<object, object, TUpdateDynamicSecretDTO>({
|
||||
mutationFn: async (dto) => {
|
||||
const { data } = await apiRequest.patch<{ dynamicSecret: TDynamicSecret }>(
|
||||
`/api/v1/dynamic-secrets/${dto.name}`,
|
||||
@@ -43,8 +45,10 @@ export const useUpdateDynamicSecret = () => {
|
||||
},
|
||||
onSuccess: (_, { path, environmentSlug, projectSlug }) => {
|
||||
// TODO: optimize but currently don't pass projectId
|
||||
queryClient.invalidateQueries(dashboardKeys.all());
|
||||
queryClient.invalidateQueries(dynamicSecretKeys.list({ path, projectSlug, environmentSlug }));
|
||||
queryClient.invalidateQueries({ queryKey: dashboardKeys.all() });
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: dynamicSecretKeys.list({ path, projectSlug, environmentSlug })
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -52,7 +56,7 @@ export const useUpdateDynamicSecret = () => {
|
||||
export const useDeleteDynamicSecret = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation<{}, {}, TDeleteDynamicSecretDTO>({
|
||||
return useMutation<object, object, TDeleteDynamicSecretDTO>({
|
||||
mutationFn: async (dto) => {
|
||||
const { data } = await apiRequest.delete<{ dynamicSecret: TDynamicSecret }>(
|
||||
`/api/v1/dynamic-secrets/${dto.name}`,
|
||||
@@ -62,8 +66,10 @@ export const useDeleteDynamicSecret = () => {
|
||||
},
|
||||
onSuccess: (_, { path, environmentSlug, projectSlug }) => {
|
||||
// TODO: optimize but currently don't pass projectId
|
||||
queryClient.invalidateQueries(dashboardKeys.all());
|
||||
queryClient.invalidateQueries(dynamicSecretKeys.list({ path, projectSlug, environmentSlug }));
|
||||
queryClient.invalidateQueries({ queryKey: dashboardKeys.all() });
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: dynamicSecretKeys.list({ path, projectSlug, environmentSlug })
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -80,12 +80,12 @@ export const useGetDynamicSecretProviderData = ({
|
||||
tenantId: string;
|
||||
applicationId: string;
|
||||
clientSecret: string;
|
||||
enabled: boolean
|
||||
enabled: boolean;
|
||||
}) => {
|
||||
return useQuery({
|
||||
queryKey: ["users"],
|
||||
queryFn: async () => {
|
||||
const { data } = await apiRequest.post<{id:string, email: string, name:string}[]>(
|
||||
const { data } = await apiRequest.post<{ id: string; email: string; name: string }[]>(
|
||||
"/api/v1/dynamic-secrets/entra-id/users",
|
||||
{
|
||||
tenantId,
|
||||
|
||||
Reference in New Issue
Block a user