mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 12:04:03 +00:00
feat: load project kms backup
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
export {
|
||||
useAddAwsExternalKms,
|
||||
useLoadProjectKmsBackup,
|
||||
useRemoveExternalKms,
|
||||
useUpdateAwsExternalKms,
|
||||
useUpdateProjectKms
|
||||
|
||||
@@ -140,3 +140,19 @@ export const useUpdateProjectKms = (projectId: string) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const useLoadProjectKmsBackup = (projectId: string) => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: async (backup: string) => {
|
||||
const { data } = await apiRequest.post(`/api/v1/workspace/${projectId}/kms/backup`, {
|
||||
backup
|
||||
});
|
||||
|
||||
return data;
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries(kmsKeys.getActiveProjectKms(projectId));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user