From 7fb60a1a9edd2d72b16b38f1d75b6ef59f56989b Mon Sep 17 00:00:00 2001 From: Shreyas2004wagh Date: Tue, 10 Feb 2026 22:33:55 +0530 Subject: [PATCH] fix(api): URL-encode searchText in chat.search --- packages/api/src/EmbeddedChatApi.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/api/src/EmbeddedChatApi.ts b/packages/api/src/EmbeddedChatApi.ts index 72e25a046..7c8d07bc6 100644 --- a/packages/api/src/EmbeddedChatApi.ts +++ b/packages/api/src/EmbeddedChatApi.ts @@ -1120,8 +1120,12 @@ export default class EmbeddedChatApi { async getSearchMessages(text: string) { try { const { userId, authToken } = (await this.auth.getCurrentUser()) || {}; + const queryParams = new URLSearchParams({ + roomId: this.rid, + searchText: text, + }); const response = await fetch( - `${this.host}/api/v1/chat.search?roomId=${this.rid}&searchText=${text}`, + `${this.host}/api/v1/chat.search?${queryParams.toString()}`, { headers: { "Content-Type": "application/json",