Merged in fix/SW-3194-cross-validation-enter-details (pull request #2604)
fix(SW-3194): crossvalidation for multiroom enter details * fix(SW-3194): crossvalidation for multiroom enter details * fix(SW-3194): use getValues Approved-by: Hrishikesh Vaipurkar
This commit is contained in:
@@ -26,8 +26,8 @@ export const multiroomErrors = {
|
||||
} as const
|
||||
|
||||
export type CrossValidationData = {
|
||||
firstName: string
|
||||
lastName: string
|
||||
firstName: string | undefined
|
||||
lastName: string | undefined
|
||||
membershipNo: string | undefined
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@ export function getMultiroomDetailsSchema(
|
||||
(data) =>
|
||||
!crossValidationData.some(
|
||||
(room) =>
|
||||
room.firstName.toLowerCase() === data.firstName.toLowerCase() &&
|
||||
room.lastName.toLowerCase() === data.lastName.toLowerCase()
|
||||
room.firstName?.toLowerCase() === data.firstName.toLowerCase() &&
|
||||
room.lastName?.toLowerCase() === data.lastName.toLowerCase()
|
||||
),
|
||||
{
|
||||
message: multiroomErrors.FIRST_AND_LAST_NAME_UNIQUE,
|
||||
@@ -85,8 +85,8 @@ export function getMultiroomDetailsSchema(
|
||||
(data) =>
|
||||
!crossValidationData.some(
|
||||
(room) =>
|
||||
room.firstName.toLowerCase() === data.firstName.toLowerCase() &&
|
||||
room.lastName.toLowerCase() === data.lastName.toLowerCase()
|
||||
room.firstName?.toLowerCase() === data.firstName.toLowerCase() &&
|
||||
room.lastName?.toLowerCase() === data.lastName.toLowerCase()
|
||||
),
|
||||
{
|
||||
message: multiroomErrors.FIRST_AND_LAST_NAME_UNIQUE,
|
||||
|
||||
Reference in New Issue
Block a user