Skip to content

Commit

Permalink
merge with Arins branch
Browse files Browse the repository at this point in the history
  • Loading branch information
begonaguereca committed Oct 4, 2024
1 parent 8fd1b58 commit b77dbf2
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/Octoshift/Services/GithubClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,6 @@ public virtual async IAsyncEnumerable<JToken> GetAllAsync(
nextUrl = GetNextUrl(headers);
} while (nextUrl != null);
}

public virtual async IAsyncEnumerable<JToken> GetAllAsyncGroupId(string url, Dictionary<string, string> customHeaders = null)
{
var nextUrl = url;
do
{
var (content, headers) = await GetWithRetry(nextUrl, customHeaders: customHeaders);
// Parse the response and check if "groups" exists
var jObject = JObject.Parse(content);
var jResponse = jObject["groups"];

if (jResponse == null || !jResponse.HasValues)
{
yield break; // No groups found, exit the iterator
}

// Yield each group
foreach (var jToken in jResponse)
{
yield return jToken;
}

// Check for the next page URL
nextUrl = GetNextUrl(headers);
} while (nextUrl != null);
}

public virtual async Task<string> PostAsync(string url, object body, Dictionary<string, string> customHeaders = null) =>
(await SendAsync(HttpMethod.Post, url, body, customHeaders: customHeaders)).Content;

Expand Down

0 comments on commit b77dbf2

Please sign in to comment.