Skip to content

Commit c6aa5a5

Browse files
authored
Merge pull request #1073 from opencrvs/fix-streetLevelAddress-validation
bug fix: street level address validation
2 parents 2790ca8 + cb6fb46 commit c6aa5a5

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/form/street-address-configuration.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
defineFormConditional,
1010
errorMessages
1111
} from '@opencrvs/toolkit/events'
12-
import { type } from 'os'
1312

1413
function isInternationalAddress() {
1514
return and(
@@ -43,12 +42,20 @@ export function getNestedFieldValidators(
4342
[fieldId]: {
4443
type: 'object',
4544
properties: {
46-
[field.id]: {
47-
minLength: 1
45+
streetLevelDetails: {
46+
type: 'object',
47+
properties: {
48+
[field.id]: {
49+
minLength: 1
50+
}
51+
},
52+
required: [field.id]
4853
}
49-
}
54+
},
55+
required: ['streetLevelDetails']
5056
}
51-
}
57+
},
58+
required: [fieldId]
5259
})
5360
}))
5461
}

0 commit comments

Comments
 (0)