I need to be able to execute await axios.post (api, data)
taking all the values of parameters
const parameters = {
userId: [ '2', '4' ],
categoryId: '2'
}
that is, all possible combinations: userId=2&categoryId=2
y userId=4&categoryId=2
What I have:
const data = {};
const api = url_api + "?" + "userId=" + userId + "&categoryId =" + categoryId;
const resp = await axios.post(api, data);
How can I do it?
And how would it be for the cases that parameters
is:
const parameters = {
userId: [ '2', '4' ],
categoryId: [ '1', '6' ]
}
all possible combinations: userId=2&categoryId=1
, userId=2&categoryId=6
, userId=4&categoryId=1
, userId=4&categoryId=6
Thanks!