Ограничить вызов ЭЛТ если в selectLead не заполнен evo_inn
This commit is contained in:
parent
2c9a2bd30c
commit
a8ae1d13cc
@ -259,6 +259,8 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let okved: string | null | undefined;
|
let okved: string | null | undefined;
|
||||||
|
let evo_inn: string | null | undefined;
|
||||||
|
|
||||||
if (leadid) {
|
if (leadid) {
|
||||||
const {
|
const {
|
||||||
data: { lead },
|
data: { lead },
|
||||||
@ -268,6 +270,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
okved = lead?.accountidData?.evo_okved;
|
okved = lead?.accountidData?.evo_okved;
|
||||||
|
evo_inn = lead?.evo_inn;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!okved && opportunityid) {
|
if (!okved && opportunityid) {
|
||||||
@ -302,6 +305,14 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
|||||||
path: ['eltKasko', 'eltOsago'],
|
path: ['eltKasko', 'eltOsago'],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!evo_inn) {
|
||||||
|
ctx.addIssue({
|
||||||
|
code: z.ZodIssueCode.custom,
|
||||||
|
message: 'ИНН в интересе не заполнен',
|
||||||
|
path: ['eltKasko', 'eltOsago'],
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user