I am quite new with Vue.js and Axios. I was working on getting and displaying data from the API by search function, and trying to figure out how to display a warning/alert or something that would let the user know API response is empty.
Observed result: App shows the data when there's a match in the search box but does not show anything when there's no exact match
Expected result: When there's no exact match showing a text or alert on the front end to indicate "there is no match"
axios.get(`API LINK HERE`,
{
headers: {
"x-rapidapi-host":"API HOST LINK HERE",
"x-rapidapi-key":"API KEY HERE",
"useQueryString":true
},"params":{
"format":"json",
"date-format":"YYYY-MM-DD",
"name":`${query}`
}
})
.then(response => this.itemData = response.data)
}```