mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-01 18:35:35 +00:00
Fix failure with 201 status code on adding a collaborator (#2559)
* fix: return RepositoryInvitation instead of throwing an exception on 201 * fix: TheAddMethod test
This commit is contained in:
@@ -172,7 +172,7 @@ namespace Octokit.Reactive
|
||||
/// <param name="user">Username of the new collaborator</param>
|
||||
/// <param name="permission">The permission to set. Only valid on organization-owned repositories.</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
IObservable<bool> Add(string owner, string name, string user, CollaboratorRequest permission);
|
||||
IObservable<RepositoryInvitation> Add(string owner, string name, string user, CollaboratorRequest permission);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new collaborator to the repository.
|
||||
@@ -195,7 +195,7 @@ namespace Octokit.Reactive
|
||||
/// <param name="user">Username of the new collaborator</param>
|
||||
/// <param name="permission">The permission to set. Only valid on organization-owned repositories.</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
IObservable<bool> Add(long repositoryId, string user, CollaboratorRequest permission);
|
||||
IObservable<RepositoryInvitation> Add(long repositoryId, string user, CollaboratorRequest permission);
|
||||
|
||||
/// <summary>
|
||||
/// Invites a user as a collaborator to a repository.
|
||||
|
||||
@@ -267,7 +267,7 @@ namespace Octokit.Reactive
|
||||
/// <param name="user">Username of the new collaborator</param>
|
||||
/// <param name="permission">The permission to set. Only valid on organization-owned repositories.</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
public IObservable<bool> Add(string owner, string name, string user, CollaboratorRequest permission)
|
||||
public IObservable<RepositoryInvitation> Add(string owner, string name, string user, CollaboratorRequest permission)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
@@ -303,7 +303,7 @@ namespace Octokit.Reactive
|
||||
/// <param name="user">Username of the new collaborator</param>
|
||||
/// <param name="permission">The permission to set. Only valid on organization-owned repositories.</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
public IObservable<bool> Add(long repositoryId, string user, CollaboratorRequest permission)
|
||||
public IObservable<RepositoryInvitation> Add(long repositoryId, string user, CollaboratorRequest permission)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(user, nameof(user));
|
||||
Ensure.ArgumentNotNull(permission, nameof(permission));
|
||||
|
||||
Reference in New Issue
Block a user