fix: validation leaseObjectMotorPower evo_id !== '8'
This commit is contained in:
parent
862e1293d3
commit
9454d9e2b2
@ -88,14 +88,6 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
});
|
||||
}
|
||||
|
||||
if (!leaseObjectMotorPower) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Не заполнено поле ' + titles.tbxLeaseObjectMotorPower,
|
||||
path: ['eltKasko', 'eltOsago'],
|
||||
});
|
||||
}
|
||||
|
||||
if (!leaseObjectUseFor) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
@ -114,6 +106,14 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
},
|
||||
});
|
||||
|
||||
if (evo_leasingobject_type?.evo_id !== '8' && !leaseObjectMotorPower) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Не заполнено поле ' + titles.tbxLeaseObjectMotorPower,
|
||||
path: ['eltKasko', 'eltOsago'],
|
||||
});
|
||||
}
|
||||
|
||||
// Проверяем на мотоцикл
|
||||
if (evo_leasingobject_type?.evo_id && ['11'].includes(evo_leasingobject_type?.evo_id)) {
|
||||
ctx.addIssue({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user