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:
@@ -46,7 +46,8 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
|
||||
|
||||
def export
|
||||
column_names = params['column_names']
|
||||
Account::ContactsExportJob.perform_later(Current.account.id, column_names, Current.user.email)
|
||||
filter_params = { :payload => params.permit!['payload'], :label => params.permit!['label'] }
|
||||
Account::ContactsExportJob.perform_later(Current.account.id, Current.user.id, column_names, filter_params)
|
||||
head :ok, message: I18n.t('errors.contacts.export.success')
|
||||
end
|
||||
|
||||
@@ -61,7 +62,7 @@ class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
|
||||
def show; end
|
||||
|
||||
def filter
|
||||
result = ::Contacts::FilterService.new(params.permit!, current_user).perform
|
||||
result = ::Contacts::FilterService.new(Current.account, Current.user, params.permit!).perform
|
||||
contacts = result[:contacts]
|
||||
@contacts_count = result[:count]
|
||||
@contacts = fetch_contacts(contacts)
|
||||
|
||||
Reference in New Issue
Block a user