Skip to content

Commit

Permalink
(GH-367) Teammates.GetAllPendingInvitationsAsync must return Paginate…
Browse files Browse the repository at this point in the history
…dResponseWithLinks
  • Loading branch information
Jericho committed Aug 4, 2024
1 parent b43c91e commit 9cd3779
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Source/StrongGrid.IntegrationTests/Tests/Teammates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public async Task RunAsync(IBaseClient client, TextWriter log, CancellationToken

// GET ALL THE PENDING INVITATIONS
var pendingInvitation = await client.Teammates.GetAllPendingInvitationsAsync(50, 0, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"There are {pendingInvitation.Length} pending invitations").ConfigureAwait(false);
await log.WriteLineAsync($"There are {pendingInvitation.Records.Length} pending invitations").ConfigureAwait(false);

// GET ALL THE TEAMMATES
var allTeammates = await client.Teammates.GetAllTeammatesAsync(50, 0, cancellationToken).ConfigureAwait(false);
Expand Down
4 changes: 2 additions & 2 deletions Source/StrongGrid/Resources/ITeammates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ public interface ITeammates
/// <param name="limit">The limit.</param>
/// <param name="offset">The offset.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>An array of <see cref="TeammateInvitation" />.</returns>
/// <returns>The <see cref="PaginatedResponseWithLinks{TeammateInvitation}" />.</returns>
/// <remarks>
/// Each teammate invitation is valid for 7 days.
/// Users may resend the invite to refresh the expiration date.
/// </remarks>
Task<TeammateInvitation[]> GetAllPendingInvitationsAsync(int limit = 10, int offset = 0, CancellationToken cancellationToken = default);
Task<PaginatedResponseWithLinks<TeammateInvitation>> GetAllPendingInvitationsAsync(int limit = 10, int offset = 0, CancellationToken cancellationToken = default);

/// <summary>
/// Delete a pending teammate invite.
Expand Down
6 changes: 3 additions & 3 deletions Source/StrongGrid/Resources/Teammates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@ public Task ResendInvitationAsync(string token, CancellationToken cancellationTo
/// <param name="limit">The limit.</param>
/// <param name="offset">The offset.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>An array of <see cref="TeammateInvitation" />.</returns>
/// <returns>The <see cref="PaginatedResponseWithLinks{TeammateInvitation}" />.</returns>
/// <remarks>
/// Each teammate invitation is valid for 7 days.
/// Users may resend the invite to refresh the expiration date.
/// </remarks>
public Task<TeammateInvitation[]> GetAllPendingInvitationsAsync(int limit = 10, int offset = 0, CancellationToken cancellationToken = default)
public Task<PaginatedResponseWithLinks<TeammateInvitation>> GetAllPendingInvitationsAsync(int limit = 10, int offset = 0, CancellationToken cancellationToken = default)
{
return _client
.GetAsync($"{_endpoint}/pending")
.WithArgument("limit", limit)
.WithArgument("offset", offset)
.WithCancellationToken(cancellationToken)
.AsObject<TeammateInvitation[]>("result");
.AsPaginatedResponseWithLinks<TeammateInvitation>("result");
}

/// <summary>
Expand Down

0 comments on commit 9cd3779

Please sign in to comment.