fix: postman collection export

This commit is contained in:
Anoop M D 2023-10-13 07:01:59 +05:30
parent 671fcecb38
commit d595032f46
3 changed files with 6 additions and 2 deletions

View File

@ -16,7 +16,6 @@ const ExportCollection = ({ onClose, collection }) => {
const handleExportPostmanCollection = () => {
const collectionCopy = cloneDeep(collection);
exportPostmanCollection(collectionCopy);
// exportPostmanCollection(transformCollectionToSaveToExportAsFile(collectionCopy));
onClose();
};

View File

@ -67,6 +67,10 @@ export const deleteSecretsInEnvs = (envs) => {
export const exportCollection = (collection) => {
// delete uids
delete collection.uid;
// delete process variables
delete collection.processEnvVariables;
deleteUidsInItems(collection.items);
deleteUidsInEnvs(collection.environments);
deleteSecretsInEnvs(collection.environments);

View File

@ -4,6 +4,7 @@ import { deleteSecretsInEnvs, deleteUidsInEnvs, deleteUidsInItems } from 'utils/
export const exportCollection = (collection) => {
delete collection.uid;
delete collection.processEnvVariables;
deleteUidsInItems(collection.items);
deleteUidsInEnvs(collection.environments);
deleteSecretsInEnvs(collection.environments);
@ -206,7 +207,7 @@ export const exportCollection = (collection) => {
collectionToExport.variable = generateCollectionVars(collection);
const fileName = `${collection.name}.json`;
const fileBlob = new Blob([JSON.stringify(collection, null, 2)], { type: 'application/json' });
const fileBlob = new Blob([JSON.stringify(collectionToExport, null, 2)], { type: 'application/json' });
FileSaver.saveAs(fileBlob, fileName);
};