Avoid throwing on getFolderIsImportedBy no folder found

This commit is contained in:
carlosmonastyrski
2025-04-15 10:19:41 -03:00
parent 68ba807b43
commit 82533f49ca

View File

@@ -825,10 +825,7 @@ export const secretImportServiceFactory = ({
);
const folder = await folderDAL.findBySecretPath(projectId, environment, secretPath);
if (!folder)
throw new NotFoundError({
message: `Folder with path '${secretPath}' in environment with slug '${environment}' not found`
});
if (!folder) return [];
const importedBy = await secretImportDAL.getFolderIsImportedBy(secretPath, folder.envId, environment, projectId);
const deepPaths: { path: string; folderId: string }[] = [];