SELECT TOP(@Take)[WorkspaceId], [Slug], [Subject], [Topic], [CreatedBy], [CreatedAt], [UpdatedAt], [Metadata]
FROM [dbo].[Conversations]
WHERE [WorkspaceId] = @WorkspaceId
  AND (@Topic IS NULL
   OR [Topic] = @Topic)
  AND (@UpdatedAfter IS NULL
   OR [UpdatedAt] >= @UpdatedAfter)
  AND (
    @Search IS NULL
   OR [Subject] LIKE @Search
   OR [Slug] LIKE @Search
    )
ORDER BY [UpdatedAt] DESC, [Slug];
