From 98e9fedfa62a4d200264234a1407bbe78984dd5e Mon Sep 17 00:00:00 2001 From: Viraj Bahulkar Date: Mon, 25 Oct 2021 19:26:11 +0530 Subject: [PATCH] fix: Resolve contacts filter when entered with contry code (#3241) Co-authored-by: Muhsin Keloth --- .../dashboard/contacts/components/ContactsView.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/javascript/dashboard/routes/dashboard/contacts/components/ContactsView.vue b/app/javascript/dashboard/routes/dashboard/contacts/components/ContactsView.vue index 4ac5c0fc7..6b1d6f6ed 100644 --- a/app/javascript/dashboard/routes/dashboard/contacts/components/ContactsView.vue +++ b/app/javascript/dashboard/routes/dashboard/contacts/components/ContactsView.vue @@ -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, }); }