I have two buttons that execute the same function, and that function needs to evaluate go backward or go forward as I show in the following image
and in the following code I want to evaluate what function next() or prev() to execute depending on which button was touched, this is built in react
const onFinish = (values) => {
if (values.users) { const Operator = values.users.map((item) => ({ ruleAttributeName: item.ruleAttributeName, isoAttributeId: item.isoAttributeId, ruleOperationId: item.ruleOperationId, mandatoryValue: item.mandatoryValue, })); setAttributes(Operator); } if (values.users) { const attributesSave = values.users.map((item) => ({ ruleAttributeName: item.ruleAttributeName, isoAttributeEntity: { isoAttributeId: item.isoAttributeId, }, ruleOperationEntity: { ruleOperationId: item.ruleOperationId, }, mandatoryValue: item.mandatoryValue, })); console.log('mandatory'; setAttributesSave(attributesSave); setMandatoryValue(); next(); prev(); };
and in this form I pass by parameter the function
<Form name='dynamic_form_nest_item' onFinish={onFinish} autoComplete='off' >
