Handle parameters more gracefully with the mixin. (#198)

This commit is contained in:
FireMasterK
2021-06-15 17:07:35 +05:30
committed by GitHub
parent b69cc4c848
commit 546e47df9b
6 changed files with 33 additions and 51 deletions

View File

@@ -49,9 +49,9 @@ export default {
}
},
async refreshSuggestions() {
this.searchSuggestions = await this.fetchJson(
Constants.BASE_URL + "/suggestions?query=" + encodeURI(this.searchText),
);
this.searchSuggestions = await this.fetchJson(Constants.BASE_URL + "/suggestions", {
query: this.searchText,
});
this.searchSuggestions.unshift(this.searchText);
this.setSelected(0);
},