add conditional imports to raw api

This commit is contained in:
Maidul Islam
2023-07-24 15:01:31 -04:00
parent 7bccfaefac
commit 8c39fa2438
@@ -59,7 +59,7 @@ export const getSecretsRaw = async (req: Request, res: Response) => {
workspaceId: new Types.ObjectId(workspaceId) workspaceId: new Types.ObjectId(workspaceId)
}); });
if (includeImports) { if (includeImports === "true") {
const folders = await Folder.findOne({ workspace: workspaceId, environment }); const folders = await Folder.findOne({ workspace: workspaceId, environment });
let folderId = "root"; let folderId = "root";
// if folder exist get it and replace folderid with new one // if folder exist get it and replace folderid with new one