Currently, I am working on integrating filterDataArray into my application to dynamically add parameters to my API requests.
For this purpose, I have initialized the filterData array as follows:
filterData: [
{key: 'name', value: ''},
{key: 'surname', value: ''},
{key: 'age', value: ''}
Next, my objective is to link my filter inputs to achieve something like this:
<v-text-field v-model="filterData.value.where(filterData.key == 'Name')">
</v-text-field>
Subsequently, I intend to pass the filterData to the APIController and construct a GET request in the following manner:
getfiltereddata(data) {
var url = `/user?filtereddata=true`;
data.forEach(element => {
url = url + `&` + element.key + `=` + element.value;
}); //I will verify if the value is not empty first
The final output should resemble this format:
/user?filtereddata=true&name=nameinput&surname=surnameinput&age=ageinput;
Your assistance with this matter would be greatly appreciated.