public async Task <IActionResult> Edit(ChallengeEdit challengeEdit)
        {
            ChallengeEditValidator validator = new ChallengeEditValidator(this._challengeService);
            ValidationResult       results   = await validator.ValidateAsync(challengeEdit);

            results.AddToModelState(ModelState, "ChallengeEdit");

            if (!ModelState.IsValid)
            {
                return(BadRequest(this.ModelState));
            }

            int connectedUserId = int.Parse(User.Identity.Name);

            User connectedUser = await this._userService.GetWithRequest(connectedUserId);

            if (connectedUser.Role != Role.Admin && (connectedUser.Role == Role.Member && !connectedUser.ParticipantGroups.Any(pg => pg.IsCreator)))
            {
                return(BadRequest("You are not an admin or the creator of this group !"));
            }

            await this._challengeService.Edit(challengeEdit);

            return(Ok());
        }
        public async Task Edit(ChallengeEdit challengeToEdit)
        {
            Challenge originalChallenge = await this.challengeRepository.Get(challengeToEdit.Id);

            originalChallenge.Name      = challengeToEdit.Name;
            originalChallenge.Statement = challengeToEdit.Statement;

            await this.challengeRepository.Update(originalChallenge);
        }