feat: Agent & Inbox Report APIs (#1391)

This commit is contained in:
Sojan Jose
2020-11-16 19:41:52 +05:30
committed by GitHub
parent faaed17418
commit eb2ded6f65
11 changed files with 102 additions and 12 deletions

View File

@@ -9,6 +9,18 @@ class Api::V2::Accounts::ReportsController < Api::V1::Accounts::BaseController
render json: account_summary_metrics
end
def agents
response.headers['Content-Type'] = 'text/csv'
response.headers['Content-Disposition'] = 'attachment; filename=agents_report.csv'
render layout: false, template: 'api/v2/accounts/reports/agents.csv.erb', format: 'csv'
end
def inboxes
response.headers['Content-Type'] = 'text/csv'
response.headers['Content-Disposition'] = 'attachment; filename=inboxes_report.csv'
render layout: false, template: 'api/v2/accounts/reports/inboxes.csv.erb', format: 'csv'
end
private
def account_summary_params