fix: Resolve contacts filter when entered with contry code (#3241)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -132,16 +132,22 @@ export default {
|
|||||||
},
|
},
|
||||||
fetchContacts(page) {
|
fetchContacts(page) {
|
||||||
this.updatePageParam(page);
|
this.updatePageParam(page);
|
||||||
|
let value = '';
|
||||||
|
if(this.searchQuery.charAt(0) === '+') {
|
||||||
|
value = this.searchQuery.substring(1);
|
||||||
|
} else {
|
||||||
|
value = this.searchQuery;
|
||||||
|
}
|
||||||
const requestParams = {
|
const requestParams = {
|
||||||
page,
|
page,
|
||||||
sortAttr: this.getSortAttribute(),
|
sortAttr: this.getSortAttribute(),
|
||||||
label: this.label,
|
label: this.label,
|
||||||
};
|
};
|
||||||
if (!this.searchQuery) {
|
if (!value) {
|
||||||
this.$store.dispatch('contacts/get', requestParams);
|
this.$store.dispatch('contacts/get', requestParams);
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('contacts/search', {
|
this.$store.dispatch('contacts/search', {
|
||||||
search: this.searchQuery,
|
search: value,
|
||||||
...requestParams,
|
...requestParams,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user