mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 13:29:12 +00:00
Merge pull request #4684 from Infisical/fix/adds-forceDelete-flag-to-folder-deletion
[ENG-3811] fix: adds delete protection in folder deletion with resources
This commit is contained in:
@@ -218,12 +218,13 @@ export const useDeleteFolder = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation<object, object, TDeleteFolderDTO>({
|
||||
mutationFn: async ({ path = "/", folderId, environment, projectId }) => {
|
||||
mutationFn: async ({ path = "/", folderId, environment, projectId, forceDelete = true }) => {
|
||||
const { data } = await apiRequest.delete(`/api/v2/folders/${folderId}`, {
|
||||
data: {
|
||||
environment,
|
||||
projectId,
|
||||
path
|
||||
path,
|
||||
forceDelete
|
||||
}
|
||||
});
|
||||
return data;
|
||||
|
||||
@@ -59,6 +59,7 @@ export type TDeleteFolderDTO = {
|
||||
environment: string;
|
||||
folderId: string;
|
||||
path?: string;
|
||||
forceDelete?: boolean;
|
||||
};
|
||||
|
||||
export type TUpdateFolderBatchDTO = {
|
||||
|
||||
Reference in New Issue
Block a user