diff --git a/studio/schemas/objects/compensations/benefitsByLocation.ts b/studio/schemas/objects/compensations/benefitsByLocation.ts index dff1067ba..71f0d2c34 100644 --- a/studio/schemas/objects/compensations/benefitsByLocation.ts +++ b/studio/schemas/objects/compensations/benefitsByLocation.ts @@ -51,10 +51,12 @@ export const benefitsByLocation = defineField({ ], validation: (Rule) => Rule.custom((benefitsByLocation) => { + const isNotDuplicate: boolean = checkForDuplicateLocations( + benefitsByLocation as DocumentWithLocation[] | undefined, + ); return ( - checkForDuplicateLocations( - benefitsByLocation as DocumentWithLocation[] | undefined, - ) || "Each location should be listed only once in the benefits list." + isNotDuplicate || + "Each location should be listed only once in the benefits list." ); }), });