CSR-319: update repair/replace validation logic

This commit is contained in:
Adam Caouette 2022-03-08 15:07:47 -05:00
parent d95e6c10dd
commit 00e62c4240

View file

@ -37,7 +37,11 @@ defineRule("windshield-chip-count-required", required(errorMessages.WINDSHIELD_C
defineRule("windshield-replace-options-required", required(errorMessages.WINSHIELD_REPLACE_OPTIONS_REQUIRED));
defineRule("checkForRepairAndReplace", (value, [other]) => {
if (value.toString().toUpperCase().includes("REPAIR") && other.toString().toUpperCase().includes("WINDSHIELD") && other.length > 1) {
if (value.toString().toUpperCase().includes("REPAIR") &&
other.toString().toUpperCase().includes("WINDSHIELD") &&
Array.isArray(other) &&
other.length > 1)
{
return "checkForRepairAndReplace error"
}
return true;