forked from extern/bruno
fix: postman collection export
This commit is contained in:
parent
671fcecb38
commit
d595032f46
@ -16,7 +16,6 @@ const ExportCollection = ({ onClose, collection }) => {
|
|||||||
const handleExportPostmanCollection = () => {
|
const handleExportPostmanCollection = () => {
|
||||||
const collectionCopy = cloneDeep(collection);
|
const collectionCopy = cloneDeep(collection);
|
||||||
exportPostmanCollection(collectionCopy);
|
exportPostmanCollection(collectionCopy);
|
||||||
// exportPostmanCollection(transformCollectionToSaveToExportAsFile(collectionCopy));
|
|
||||||
onClose();
|
onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -67,6 +67,10 @@ export const deleteSecretsInEnvs = (envs) => {
|
|||||||
export const exportCollection = (collection) => {
|
export const exportCollection = (collection) => {
|
||||||
// delete uids
|
// delete uids
|
||||||
delete collection.uid;
|
delete collection.uid;
|
||||||
|
|
||||||
|
// delete process variables
|
||||||
|
delete collection.processEnvVariables;
|
||||||
|
|
||||||
deleteUidsInItems(collection.items);
|
deleteUidsInItems(collection.items);
|
||||||
deleteUidsInEnvs(collection.environments);
|
deleteUidsInEnvs(collection.environments);
|
||||||
deleteSecretsInEnvs(collection.environments);
|
deleteSecretsInEnvs(collection.environments);
|
||||||
|
@ -4,6 +4,7 @@ import { deleteSecretsInEnvs, deleteUidsInEnvs, deleteUidsInItems } from 'utils/
|
|||||||
|
|
||||||
export const exportCollection = (collection) => {
|
export const exportCollection = (collection) => {
|
||||||
delete collection.uid;
|
delete collection.uid;
|
||||||
|
delete collection.processEnvVariables;
|
||||||
deleteUidsInItems(collection.items);
|
deleteUidsInItems(collection.items);
|
||||||
deleteUidsInEnvs(collection.environments);
|
deleteUidsInEnvs(collection.environments);
|
||||||
deleteSecretsInEnvs(collection.environments);
|
deleteSecretsInEnvs(collection.environments);
|
||||||
@ -206,7 +207,7 @@ export const exportCollection = (collection) => {
|
|||||||
collectionToExport.variable = generateCollectionVars(collection);
|
collectionToExport.variable = generateCollectionVars(collection);
|
||||||
|
|
||||||
const fileName = `${collection.name}.json`;
|
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);
|
FileSaver.saveAs(fileBlob, fileName);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user