I would like to submit only queryParams parameters which have values !== null, but I am not sure how to write it down. So the submit function looks like this:
onSubmit() {
const queryParams =
'&name=' +
this.name +
'&date_from=' +
this.startDate +
'&date_to=' +
this.endDate;
this.callAPI({
queryParams: queryParams
});
}
I am not sure where to do that check... I realize that something like this is wrong:
this.callAPI({
queryParams: queryParams !== null
});
What would be a correct way to check this?