mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-10 08:05:22 +02:00
chore: add call disposition in report
This commit is contained in:
parent
4d807266a7
commit
22c2a3ba89
2 changed files with 7 additions and 1 deletions
|
|
@ -697,6 +697,7 @@ async def download_campaign_report(
|
|||
"Created At",
|
||||
"Customer Name",
|
||||
"Phone Number",
|
||||
"Call Disposition",
|
||||
"Call Tags",
|
||||
"Call Duration (s)",
|
||||
"Transcript",
|
||||
|
|
@ -726,6 +727,7 @@ async def download_campaign_report(
|
|||
run.created_at.isoformat() if run.created_at else "",
|
||||
initial.get("first_name", ""),
|
||||
initial.get("phone_number", ""),
|
||||
gathered.get("mapped_call_disposition", ""),
|
||||
call_tags,
|
||||
cost.get("call_duration_seconds", ""),
|
||||
_transcript_from_logs(run.logs),
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ export default function CampaignDetailPage() {
|
|||
|
||||
// Action state
|
||||
const [isExecutingAction, setIsExecutingAction] = useState(false);
|
||||
const [isDownloadingReport, setIsDownloadingReport] = useState(false);
|
||||
|
||||
// Fetch campaign details
|
||||
const fetchCampaign = useCallback(async () => {
|
||||
|
|
@ -115,6 +116,7 @@ export default function CampaignDetailPage() {
|
|||
// Handle download report
|
||||
const handleDownloadReport = async () => {
|
||||
if (!user) return;
|
||||
setIsDownloadingReport(true);
|
||||
try {
|
||||
const accessToken = await getAccessToken();
|
||||
const response = await downloadCampaignReportApiV1CampaignCampaignIdReportGet({
|
||||
|
|
@ -143,6 +145,8 @@ export default function CampaignDetailPage() {
|
|||
} catch (error) {
|
||||
console.error('Failed to download report:', error);
|
||||
toast.error('Failed to download report');
|
||||
} finally {
|
||||
setIsDownloadingReport(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -364,7 +368,7 @@ export default function CampaignDetailPage() {
|
|||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Button variant="outline" onClick={handleDownloadReport}>
|
||||
<Button variant="outline" onClick={handleDownloadReport} disabled={isDownloadingReport}>
|
||||
<Download className="h-4 w-4 mr-2" />
|
||||
Download Report
|
||||
</Button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue