fix: custom requirements and machine name comparison standardization
This commit is contained in:
parent
348260931e
commit
9760f02a0e
2 changed files with 7 additions and 3 deletions
|
|
@ -125,7 +125,11 @@ const validationSchema = Yup.object().shape({
|
|||
.test(
|
||||
'unique-name',
|
||||
'Machine name is already in use.',
|
||||
(value, context) => !context.options.context.machineNames.includes(value)
|
||||
(value, context) =>
|
||||
!R.any(
|
||||
it => R.equals(R.toLower(it), R.toLower(value)),
|
||||
context.options.context.machineNames
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ const validationSchema = existingRequirements =>
|
|||
'unique-name',
|
||||
'A custom information requirement with that name already exists',
|
||||
(value, _context) =>
|
||||
!R.includes(
|
||||
value,
|
||||
!R.any(
|
||||
it => R.equals(R.toLower(it), R.toLower(value)),
|
||||
R.map(it => it.customRequest.name, existingRequirements)
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue