diff --git a/app/javascript/components/automate-method-form/automate-method-input-parameter/helper.js b/app/javascript/components/automate-method-form/automate-method-input-parameter/helper.js index 571093133dbc..b3f89be1082d 100644 --- a/app/javascript/components/automate-method-form/automate-method-input-parameter/helper.js +++ b/app/javascript/components/automate-method-form/automate-method-input-parameter/helper.js @@ -52,7 +52,6 @@ export const handleInputParameterUpdate = (actionType, data, formData) => { if (actionType !== InputParameterRecordActions.DELETE) { inputParameter.modal = false; - inputParameter.selectedId = undefined; } switch (actionType) { @@ -64,15 +63,19 @@ export const handleInputParameterUpdate = (actionType, data, formData) => { break; case InputParameterRecordActions.CLOSE: inputParameter.modal = false; + inputParameter.selectedId = undefined; break; case InputParameterRecordActions.ADD: inputParameter.items.push(data.values); + inputParameter.selectedId = undefined; break; case InputParameterRecordActions.UPDATE: inputParameter.items[inputParameter.selectedId] = data.values; + inputParameter.selectedId = undefined; break; case InputParameterRecordActions.DELETE: inputParameter.items.splice(data.selectedId, 1); + inputParameter.selectedId = undefined; break; default: console.warn(__('Unknown action')); @@ -97,12 +100,3 @@ export const reducer = (state, action) => { return state; } }; - -export const handleManagerChange = (formData, setFormData, dispatch) => (managerId) => { - dispatch({ type: 'SET_MANAGER_ID', payload: managerId }); - setFormData({ - ...formData, - // eslint-disable-next-line radix - manager_id: parseInt(managerId), - }); -};