Skip to content

Commit

Permalink
Don't show error when field is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefwint committed Jun 18, 2024
1 parent c45c51d commit 1b6c33e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/validation/objectGeneralInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const SCHEMA_GENERAL_INFORMATION = object({
},
ctx
) => {
if (Owner_1_UUID === Owner_2_UUID) {
if (!!Owner_1_UUID && !!Owner_2_UUID && Owner_1_UUID === Owner_2_UUID) {
ctx.addIssue({
code: 'custom',
message:
Expand All @@ -34,7 +34,11 @@ export const SCHEMA_GENERAL_INFORMATION = object({
})
}

if (Portfolio_Holder_1_UUID === Portfolio_Holder_2_UUID) {
if (
!!Portfolio_Holder_1_UUID &&
!!Portfolio_Holder_2_UUID &&
Portfolio_Holder_1_UUID === Portfolio_Holder_2_UUID
) {
ctx.addIssue({
code: 'custom',
message:
Expand Down

0 comments on commit 1b6c33e

Please sign in to comment.