From ee2ca2129111face0fa118bc0800b549bf601009 Mon Sep 17 00:00:00 2001
From: Bharath Balan <62698609+bhabalan@users.noreply.github.com>
Date: Tue, 12 Nov 2024 17:41:40 +0530
Subject: [PATCH] feat(cc): getBuddyAgents add more checks to KS
---
docs/samples/contact-center/app.js | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/docs/samples/contact-center/app.js b/docs/samples/contact-center/app.js
index 2000f2427d7..474f8004a61 100644
--- a/docs/samples/contact-center/app.js
+++ b/docs/samples/contact-center/app.js
@@ -189,7 +189,13 @@ async function fetchBuddyAgents() {
buddyAgentsDropdownElm.innerHTML = ''; // Clear previous options
const buddyAgentsResponse = await webex.cc.getBuddyAgents({mediaType: 'telephony'});
- if (buddyAgentsResponse.data && buddyAgentsResponse.data.agentList.length === 0) {
+ if (!buddyAgentsResponse || !buddyAgentsResponse.data) {
+ console.error('Failed to fetch buddy agents');
+ buddyAgentsDropdownElm.innerHTML = `