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 };