Skip to content

Commit

Permalink
Fixed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sunil-lakshman committed Jan 8, 2025
1 parent 612cd36 commit 093969e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/contentstack-import/src/import/modules/global-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default class ImportGlobalFields extends BaseClass {
const onSuccess = ({ response: globalField, apiData: { uid } = undefined }: any) => {
this.createdGFs.push(globalField);
this.gFsUidMapper[uid] = globalField;
log(this.importConfig, `Global field ${globalField.uid} created successfully`, 'success');
log(this.importConfig, `Global field ${globalField.uid} created successfully`, 'success');
};
const onReject = ({ error, apiData: globalField = undefined }: any) => {
const uid = globalField?.uid;
Expand Down Expand Up @@ -174,12 +174,15 @@ export default class ImportGlobalFields extends BaseClass {
removeReferenceFields(globalField.schema, flag, this.stack);
if (flag.supressed) {
this.pendingGFs.push(globalField.uid);
apiOptions.entity = undefined;
}
else{
const globalFieldPayload = this.stack.globalField(globalField.uid, { api_version: '3.2' });
Object.assign(globalFieldPayload, cloneDeep(globalField), {
stackHeaders: globalFieldPayload.stackHeaders,
});
apiOptions.apiData = globalFieldPayload;
}
const globalFieldPayload = this.stack.globalField(globalField.uid, { api_version: '3.2' });
Object.assign(globalFieldPayload, cloneDeep(globalField), {
stackHeaders: globalFieldPayload.stackHeaders,
});
apiOptions.apiData = globalFieldPayload;
return apiOptions;
}

Expand Down

0 comments on commit 093969e

Please sign in to comment.