Skip to content

Commit 4236682

Browse files
author
Andreas Brandt
committed
Use SetQueryParam for company list request
1 parent e0f22ad commit 4236682

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

HubSpot.NET/Api/Company/HubSpotCompanyApi.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ public HubSpotCompanyApi(IHubSpotClient client)
7272
opts = new ListRequestOptions();
7373
}
7474

75-
var propsArgs = opts != null && opts.PropertiesToInclude.Any() ? "?properties=" + string.Join("&properties=", opts.PropertiesToInclude) : string.Empty;
76-
77-
var path = $"{new CompanyHubSpotModel().RouteBasePath}/companies/paged{propsArgs}"
75+
var path = $"{new CompanyHubSpotModel().RouteBasePath}/companies/paged"
7876
.SetQueryParam("count", opts.Limit);
7977

78+
if (opts.PropertiesToInclude.Any())
79+
{
80+
path.SetQueryParam("properties", opts.PropertiesToInclude);
81+
}
8082
if (opts.Offset.HasValue)
8183
{
8284
path = path.SetQueryParam("offset", opts.Offset);

0 commit comments

Comments
 (0)