Пример #1
0
        public async Task Reinvite(Guid providerId, Guid id)
        {
            if (!_currentContext.ProviderManageUsers(providerId))
            {
                throw new NotFoundException();
            }

            var invite = ProviderUserInviteFactory.CreateReinvite(new[] { id },
                                                                  _userService.GetProperUserId(User).Value, providerId);
            await _providerService.ResendInvitesAsync(invite);
        }
Пример #2
0
        public async Task <ListResponseModel <ProviderUserBulkResponseModel> > BulkReinvite(Guid providerId, [FromBody] ProviderUserBulkRequestModel model)
        {
            if (!_currentContext.ProviderManageUsers(providerId))
            {
                throw new NotFoundException();
            }

            var invite = ProviderUserInviteFactory.CreateReinvite(model.Ids, _userService.GetProperUserId(User).Value, providerId);
            var result = await _providerService.ResendInvitesAsync(invite);

            return(new ListResponseModel <ProviderUserBulkResponseModel>(
                       result.Select(t => new ProviderUserBulkResponseModel(t.Item1.Id, t.Item2))));
        }