Skip to content

Commit 8c675f9

Browse files
authored
Merge pull request #315 from contentstack/fix/entry-publish
fix: added local env mapping for entries as 1x
2 parents 6aad8da + af38948 commit 8c675f9

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

  • packages/contentstack-import/src/import/modules

packages/contentstack-import/src/import/modules/entries.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,9 +1381,15 @@ export default class EntriesImport extends BaseClass {
13811381
});
13821382

13831383
if (chunk) {
1384-
const apiContent = values(chunk as Record<string, any>[]).filter(
1385-
(content) => content?.publish_details?.length > 0,
1386-
);
1384+
const apiContent = values(chunk as Record<string, any>[])
1385+
.filter((content) => content?.publish_details?.length > 0)
1386+
.flatMap((content) =>
1387+
content.publish_details.map((pubDetail: any) => ({
1388+
...content,
1389+
locale: pubDetail.locale,
1390+
publish_details: [pubDetail],
1391+
})),
1392+
);
13871393

13881394
log.debug(`Processing ${apiContent.length} publishable entries in chunk ${index}`, this.importConfig.context);
13891395

0 commit comments

Comments
 (0)