Exemplo n.º 1
0
        public async Task <ActionResult> PromoteUserToModerator(Guid groupId, [FromBody] PromoteUserToModerator command)
        {
            command.UserId  = User.GetUserId();
            command.GroupId = groupId;
            await _groupService.PromoteUserToModerator(command);

            return(Ok());
        }
Exemplo n.º 2
0
        public async Task PromoteUserToModerator(PromoteUserToModerator command)
        {
            await _administratorService.ValidateAtLeastAdministrator(command.UserId, command.GroupId);

            var group = await _groupRepository.GetWithAllUsers(command.GroupId);

            group.PromoteToMod(command.UserEmailToPromote);
            await _groupRepository.SaveChangesAsync();
        }