From 2f1ade5c87f905841ac88b0ff4034c34feadb72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ethan=E5=93=A5?= Date: Tue, 7 Apr 2026 14:39:30 +0800 Subject: [PATCH] Fix: conditionally append parentId to URL search parameters in list direct messages function Committer: Ethan-Zhang --- .../webex-messaging/list-direct-messages.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/webex-public-workspace/webex-messaging/list-direct-messages.js b/tools/webex-public-workspace/webex-messaging/list-direct-messages.js index 277284c..f5206cf 100644 --- a/tools/webex-public-workspace/webex-messaging/list-direct-messages.js +++ b/tools/webex-public-workspace/webex-messaging/list-direct-messages.js @@ -13,7 +13,7 @@ const executeFunction = async ({ parentId, personId, personEmail }) => { try { // Construct the URL with query parameters const url = new URL(getWebexUrl('/messages/direct')); - url.searchParams.append('parentId', parentId); + if (parentId) url.searchParams.append('parentId', parentId); // Add either personId OR personEmail, not both if (personId) { @@ -82,4 +82,4 @@ const apiTool = { } }; -export { apiTool }; \ No newline at end of file +export { apiTool };