Skip to content

Commit

Permalink
refactor: export csv code
Browse files Browse the repository at this point in the history
  • Loading branch information
aman19K committed Feb 13, 2024
1 parent 10a0e58 commit 6fec133
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/contentstack-export-to-csv/src/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1181,13 +1181,11 @@ async function createImportableCSV(payload, taxonomies) {
try {
let taxonomiesData = [];
let headers = [];
for (let index = 0; index < taxonomies?.length; index++) {
const taxonomy = taxonomies[index];
const taxonomyUID = taxonomy?.uid;
if (taxonomyUID) {
payload['type'] = 'export-taxonomies';
payload['format'] = 'csv';
payload['taxonomyUID'] = taxonomyUID;
payload['type'] = 'export-taxonomies';
payload['format'] = 'csv';
for (const taxonomy of taxonomies) {
if (taxonomy?.uid) {
payload['taxonomyUID'] = taxonomy?.uid;
const data = await taxonomySDKHandler(payload);
const taxonomies = await csvParse(data, headers);
taxonomiesData.push(...taxonomies);
Expand Down

0 comments on commit 6fec133

Please sign in to comment.