I have a problem on how to remove specific param that is passed as payload whenever the value is empty or null
Here is my code:
dispatch({
type: 'REQUEST_DATA',
payload: {
cardNo: accId,
types: dataTypes,
accOwner: accountOwner,
},
});
Expected is: if accountOwner is empty, then accOwner param should not be passed as payload, same as the other params