I need to figure out how to submit only the queryParams parameters with values that are not null. Here's the current code for the submit function:
onSubmit() {
const queryParams =
'&name=' +
this.name +
'&date_from=' +
this.startDate +
'&date_to=' +
this.endDate;
this.callAPI({
queryParams: queryParams
});
}
I'm unsure about where to add the check for null values. I know trying something like this is incorrect:
this.callAPI({
queryParams: queryParams !== null
});
What would be the right way to handle this?