process/supplier-agent: trigger validation on change condition options
This commit is contained in:
parent
ba283d3b99
commit
630b6733ed
@ -14,8 +14,8 @@ export default function reactions(context: ProcessContext) {
|
||||
|
||||
const helper = new ValidationHelper();
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
() => {
|
||||
const values = $calculation.$values.getValues([
|
||||
'calcBrokerRewardCondition',
|
||||
'calcBrokerRewardSum',
|
||||
'calcDoubleAgentRewardCondition',
|
||||
@ -35,8 +35,22 @@ export default function reactions(context: ProcessContext) {
|
||||
'indAgentRewardSumm',
|
||||
'calcDoubleAgent',
|
||||
'calcBroker',
|
||||
]),
|
||||
async (values) => {
|
||||
]);
|
||||
|
||||
const options = (
|
||||
[
|
||||
'selectCalcBrokerRewardCondition',
|
||||
'selectCalcDoubleAgentRewardCondition',
|
||||
'selectDealerBrokerRewardCondition',
|
||||
'selectDealerRewardCondition',
|
||||
'selectFinDepartmentRewardCondtion',
|
||||
'selectIndAgentRewardCondition',
|
||||
] as Elements[]
|
||||
).map((elementName) => $calculation.element(elementName).getOptions());
|
||||
|
||||
return { options, values };
|
||||
},
|
||||
async ({ values }) => {
|
||||
helper.removeErrors();
|
||||
const validationResult = await validationSchema.safeParseAsync(values);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user