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

org sync fixes

This commit is contained in:
Kyle Spearrin
2017-05-13 17:08:56 -04:00
parent a0ac7242b6
commit 56f9ea0207
3 changed files with 10 additions and 4 deletions

View File

@ -230,7 +230,7 @@ namespace Bit.Api.Controllers
}
[HttpPost("{id}/import")]
public Task Import(string id, [FromBody]ImportOrganizationUsersRequestModel model)
public async Task Import(string id, [FromBody]ImportOrganizationUsersRequestModel model)
{
var orgIdGuid = new Guid(id);
if(!_currentContext.OrganizationAdmin(orgIdGuid))
@ -238,7 +238,9 @@ namespace Bit.Api.Controllers
throw new NotFoundException();
}
return Task.FromResult(0);
var userId = _userService.GetProperUserId(User);
await _organizationService.ImportAsync(orgIdGuid, userId.Value, model.Groups.Select(g => g.ToGroup(orgIdGuid)),
model.Users.Select(u => u.ToKvp()));
}
}
}