1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

Bulk re-invite of org users (#1316)

* Add APIs for Bulk reinvinte

* Resolve review comments.
This commit is contained in:
Oscar Hinton
2021-05-12 11:18:25 +02:00
committed by GitHub
parent 69c2673f1f
commit e2f633dace
9 changed files with 98 additions and 1 deletions

View File

@ -129,6 +129,19 @@ namespace Bit.Api.Controllers
var userId = _userService.GetProperUserId(User);
var result = await _organizationService.InviteUserAsync(orgGuidId, userId.Value, null, new OrganizationUserInvite(model));
}
[HttpPost("reinvite")]
public async Task BulkReinvite(string orgId, [FromBody]OrganizationUserBulkReinviteRequestModel model)
{
var orgGuidId = new Guid(orgId);
if (!_currentContext.ManageUsers(orgGuidId))
{
throw new NotFoundException();
}
var userId = _userService.GetProperUserId(User);
await _organizationService.ResendInvitesAsync(orgGuidId, userId.Value, model.Ids);
}
[HttpPost("{id}/reinvite")]
public async Task Reinvite(string orgId, string id)