fix(folders): fixed algorithm missing in rollback versions and resolved env change reset folderid

This commit is contained in:
akhilmhdh
2023-06-04 13:18:05 +05:30
parent 467e85b717
commit 6ce0f48b2c
5 changed files with 35 additions and 18 deletions
@@ -116,7 +116,7 @@ export const updateFolderById = async (req: Request, res: Response) => {
await EESecretService.takeSecretSnapshot({
workspaceId,
environment,
folderId: parentFolder.name === "root" ? undefined : parentFolder.id,
folderId: parentFolder.id,
});
}
@@ -649,7 +649,7 @@ export const getSecrets = async (req: Request, res: Response) => {
const folders = await Folder.findOne({ workspace: workspaceId, environment });
if (
(!folders && folderId !== "root" && folderId) ||
(!folders && folderId && folderId !== "root") ||
(!folders && secretPath)
) {
throw BadRequestError({ message: "Folder not found" });