fix: Resolve contacts filter when entered with contry code (#3241)

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Viraj Bahulkar 2021-10-25 19:26:11 +05:30 committed by GitHub
parent f2c6799444
commit 98e9fedfa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,16 +132,22 @@ export default {
},
fetchContacts(page) {
this.updatePageParam(page);
let value = '';
if(this.searchQuery.charAt(0) === '+') {
value = this.searchQuery.substring(1);
} else {
value = this.searchQuery;
}
const requestParams = {
page,
sortAttr: this.getSortAttribute(),
label: this.label,
};
if (!this.searchQuery) {
if (!value) {
this.$store.dispatch('contacts/get', requestParams);
} else {
this.$store.dispatch('contacts/search', {
search: this.searchQuery,
search: value,
...requestParams,
});
}