process/configurator: separate tarifId check for selectTarif issue

This commit is contained in:
vchikalkin 2024-02-12 12:17:52 +03:00
parent 1940f6e07d
commit 582310f59c

View File

@ -74,6 +74,14 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
const { tarif: tarifId, parmentsDecreasePercent } = values;
if (!tarifId) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'Тариф не выбран',
path: ['selectTarif'],
});
}
if (tarifId) {
const {
data: { evo_tarif },
@ -94,12 +102,6 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
path: ['tbxParmentsDecreasePercent'],
});
}
} else {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'Тариф не выбран',
path: ['selectTarif'],
});
}
/**