fix: update folder deletion logic to use findOne for subfolder lookup

This commit is contained in:
Piyush Gupta
2025-10-17 01:32:40 +05:30
parent a14c8d5b37
commit fcd42a9322
@@ -709,7 +709,7 @@ export const secretFolderServiceFactory = ({
const dynamicSecret = await dynamicSecretDAL.findOne({ folderId: folderToDelete.id }).catch(() => null); const dynamicSecret = await dynamicSecretDAL.findOne({ folderId: folderToDelete.id }).catch(() => null);
if (dynamicSecret) throw error; if (dynamicSecret) throw error;
const subfolder = await folderDAL.findByParentId(folderToDelete.id).catch(() => null); const subfolder = await folderDAL.findOne({ parentId: folderToDelete.id }).catch(() => null);
if (subfolder) throw error; if (subfolder) throw error;
} }