oauth-1.0a
oauth-1.0a copied to clipboard
Remove empty keys
I was using this package for to handle oauth and making rest api requests to magento. In the filters to the endpoint I had a trailing &
which made the request fail, so thought it would be a good idea to actually remove all empty parameters e.g
const searchCriteria =
'searchCriteria[filter_groups][0][filters][0][field]=entity_id&' +
'searchCriteria[filter_groups][0][filters][0][value]=' + id + '&' +
'searchCriteria[filter_groups][1][filters][0][field]=status&' +
'searchCriteria[filter_groups][1][filters][0][value]=1&';
Here I really would like to remove the trailing &
.