diff --git a/src/lib/search-helpers.ts b/src/lib/search-helpers.ts index a5bd397..1263bd2 100644 --- a/src/lib/search-helpers.ts +++ b/src/lib/search-helpers.ts @@ -211,6 +211,7 @@ export async function runSearch( function buildSearchResultUrl( workspaceId: number, result: { + id: string type: string threadId?: string | null channelId?: string | null @@ -233,10 +234,17 @@ function buildSearchResultUrl( commentId: result.commentId, }) } + if (result.type === 'conversation') { + return getFullCommsURL({ workspaceId, conversationId: result.id }) + } if (result.type === 'message' && result.conversationId) { - return getFullCommsURL({ workspaceId, conversationId: result.conversationId }) + return getFullCommsURL({ + workspaceId, + conversationId: result.conversationId, + messageId: result.id, + }) } - return `https://comms.todoist.com/a/${workspaceId}` + return `https://comms.todoist.com/${workspaceId}` } type SearchOutputOptions = Pick