Merge pull request #1418 from akhilmhdh/fix/import-sec-500

fix: resolved secret import secrets failing when folder has empty secrets
This commit is contained in:
Maidul Islam
2024-02-17 11:11:58 -05:00
committed by GitHub
@@ -41,13 +41,12 @@ export const fnSecretsFromImports = async ({
environment: importEnv.slug, environment: importEnv.slug,
environmentInfo: importEnv, environmentInfo: importEnv,
folderId: importedFolders?.[i]?.id, folderId: importedFolders?.[i]?.id,
secrets: importedFolders?.[i]?.id // this will ensure for cases when secrets are empty. Could be due to missing folder for a path or when emtpy secrets inside a given path
? importedSecsGroupByFolderId[importedFolders?.[i]?.id as string].map((item) => ({ secrets: (importedSecsGroupByFolderId?.[importedFolders?.[i]?.id as string] || []).map((item) => ({
...item, ...item,
environment: importEnv.slug, environment: importEnv.slug,
workspace: "", // This field should not be used, it's only here to keep the older Python SDK versions backwards compatible with the new Postgres backend. workspace: "", // This field should not be used, it's only here to keep the older Python SDK versions backwards compatible with the new Postgres backend.
_id: item.id // The old Python SDK depends on the _id field being returned. We return this to keep the older Python SDK versions backwards compatible with the new Postgres backend. _id: item.id // The old Python SDK depends on the _id field being returned. We return this to keep the older Python SDK versions backwards compatible with the new Postgres backend.
})) }))
: []
})); }));
}; };