From 91cc0a3499e10629cc5f196a92998e6f856bd79d Mon Sep 17 00:00:00 2001 From: raj pandey Date: Tue, 7 May 2024 15:04:46 +0530 Subject: [PATCH] used the length property to validate the missing mandatory fields, avoiding removal of all the entries --- packages/contentstack-audit/src/modules/entries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contentstack-audit/src/modules/entries.ts b/packages/contentstack-audit/src/modules/entries.ts index 7a4d5da408..bc3f5013bb 100644 --- a/packages/contentstack-audit/src/modules/entries.ts +++ b/packages/contentstack-audit/src/modules/entries.ts @@ -122,7 +122,7 @@ export default class Entries { const fields = this.missingMandatoryFields[uid]; const isPublished = entry.publish_details.length > 0; - if ((this.fix && fields && isPublished) || (!this.fix && fields)) { + if ((this.fix && fields.length && isPublished) || (!this.fix && fields)) { const fixStatus = this.fix ? 'Fixed' : ''; fields?.forEach((field: { isPublished: boolean; fixStatus?: string }) => { field.isPublished = isPublished;