Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
feat: adds support for importing content groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Enngage committed Jan 23, 2020
1 parent b7b8dc5 commit e542b7d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
],
"license": "MIT",
"dependencies": {
"@kentico/kontent-management": "0.3.16",
"@kentico/kontent-management": "0.3.17",
"jszip": "3.2.2",
"rxjs": "6.5.4",
"yargs": "15.1.0",
Expand Down
12 changes: 10 additions & 2 deletions src/import/import.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,19 @@ export class ImportService {
const createdContentType = await this.client
.addContentType()
.withData(builder => {
// process content groups for content groups
contentType.content_groups?.forEach(m => {
m.external_id = m.id;
delete m.id;
delete m.codename;
});

return {
elements: [],
name: contentType.name,
codename: contentType.codename,
content_groups: []
content_groups: contentType.content_groups,
external_id: contentType.external_id
};
})
.toPromise()
Expand Down Expand Up @@ -600,7 +608,7 @@ export class ImportService {
elements: [],
name: contentTypeSnippet.name,
codename: contentTypeSnippet.codename,
content_groups: []
external_id: contentTypeSnippet.external_id
};
})
.toPromise()
Expand Down

0 comments on commit e542b7d

Please sign in to comment.