process/configurator: separate tarifId check for selectTarif issue
This commit is contained in:
parent
1940f6e07d
commit
582310f59c
@ -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'],
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user