public bool AddObstacle(int idChallenge, ChallengeCreation.ObstacleCreation obstacle) { var mappedObstacle = _mapper.Map <Obstacle>(obstacle); return(_challengeRepository.AddObstacle(idChallenge, mappedObstacle)); }
public IActionResult AddObstacle([FromRoute(Name = "id")] int idChallenge, [FromRoute(Name = "idPath")] int idPath, ChallengeCreation.ObstacleCreation obstacle) { if (obstacle == null) { return(BadRequest()); } var isSuccefull = _challengeCommand.AddObstacle(idChallenge, obstacle); if (!isSuccefull) { return(StatusCode(StatusCodes.Status500InternalServerError)); } return(Ok()); }