feat: exporting contacts takes the filters into account (#9347)

- This PR allows contacts to be exported using the current filter in CRM view

Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
Shivam Mishra
2024-05-08 08:48:36 +05:30
committed by GitHub
parent de044e29f0
commit 2ef767d60f
12 changed files with 213 additions and 65 deletions

View File

@@ -1,6 +1,13 @@
class Contacts::FilterService < FilterService
ATTRIBUTE_MODEL = 'contact_attribute'.freeze
def initialize(account, user, params)
@account = account
# TODO: Change the order of arguments in FilterService maybe?
# account, user, params makes more sense
super(params, user)
end
def perform
@contacts = query_builder(@filters['contacts'])
@@ -21,8 +28,9 @@ class Contacts::FilterService < FilterService
end
end
# TODO: @account.contacts.resolved_contacts ? to stay consistant with the behavior in ui
def base_relation
Current.account.contacts
@account.contacts
end
def filter_config