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:
Piyush Gupta
2025-10-17 17:19:30 +05:30
committed by GitHub
9 changed files with 45 additions and 13 deletions
@@ -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 = {