From b4d6dfed351a16ebd13fb60726cdcc504331462f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Barr=C3=A9?= Date: Thu, 24 Jun 2021 04:17:30 -0400 Subject: [PATCH] Fix url generation when "search" is null (#31) --- NGitLab/Impl/GroupsClient.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NGitLab/Impl/GroupsClient.cs b/NGitLab/Impl/GroupsClient.cs index 8844f3f4..05a4cbb9 100644 --- a/NGitLab/Impl/GroupsClient.cs +++ b/NGitLab/Impl/GroupsClient.cs @@ -85,7 +85,10 @@ public IEnumerable Search(string search) public IEnumerable SearchProjects(int groupId, string search) { - return _api.Get().GetAll(Utils.AddOrderBy(Url + "/" + groupId + $"/projects?search={Uri.EscapeDataString(search)}")); + var url = Url + "/" + Uri.EscapeDataString(groupId.ToString(CultureInfo.InvariantCulture)) + "/projects"; + url = Utils.AddParameter(url, "search", search); + url = Utils.AddOrderBy(url); + return _api.Get().GetAll(url); } public Group Create(GroupCreate group) => _api.Post().With(group).To(Url);