public async Task <ActionResult> PromoteUserToModerator(Guid groupId, [FromBody] PromoteUserToModerator command) { command.UserId = User.GetUserId(); command.GroupId = groupId; await _groupService.PromoteUserToModerator(command); return(Ok()); }
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(); }