Merge pull request #1517 from rhythmbhiwani/fix-rename-bug

Stop ability to rename a secret to empty name from frontend
This commit is contained in:
Daniel Hougaard
2024-03-06 05:09:59 +01:00
committed by GitHub
4 changed files with 41 additions and 29 deletions
@@ -375,6 +375,10 @@ export const secretServiceFactory = ({
await projectDAL.checkProjectUpgradeStatus(projectId);
if (inputSecret.newSecretName === "") {
throw new BadRequestError({ message: "New secret name cannot be empty" });
}
const folder = await folderDAL.findBySecretPath(projectId, environment, path);
if (!folder) throw new BadRequestError({ message: "Folder not found", name: "Create secret" });
const folderId = folder.id;