Skip to content

Commit

Permalink
replace validation
Browse files Browse the repository at this point in the history
  • Loading branch information
anemne committed Sep 5, 2024
1 parent f866682 commit a6ae1a8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions studio/schemas/objects/compensations/benefitsByLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
}),
});

0 comments on commit a6ae1a8

Please sign in to comment.