Skip to content

Commit ff28208

Browse files
authored
Merge pull request #1826 from contentstack/fix/DX-2354
Fix false flagging of global fields
2 parents 1562256 + 23e9c64 commit ff28208

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/contentstack-audit/src/modules/content-types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,9 @@ export default class ContentType {
540540
});
541541
} else if (!field.schema && this.moduleName === 'content-types') {
542542
const gfSchema = find(this.gfSchema, { uid: field.reference_to })?.schema;
543-
544543
if (gfSchema) {
545544
field.schema = gfSchema as GlobalFieldSchemaTypes[];
546-
545+
} else {
547546
this.missingRefs[this.currentUid].push({
548547
tree,
549548
data_type,
@@ -558,8 +557,11 @@ export default class ContentType {
558557
} else if (!field.schema && this.moduleName === 'global-fields') {
559558
const gfSchema = find(this.gfSchema, { uid: field.reference_to })?.schema;
560559
if (gfSchema) {
560+
561561
field.schema = gfSchema as GlobalFieldSchemaTypes[];
562562

563+
564+
} else {
563565
this.missingRefs[this.currentUid].push({
564566
tree,
565567
data_type,
@@ -572,7 +574,6 @@ export default class ContentType {
572574
});
573575
}
574576
}
575-
576577
return refExist ? field : null;
577578
}
578579

0 commit comments

Comments
 (0)