Exemplo n.º 1
0
        public IActionResult FinishModule(
            [FromRoute, SwaggerParameter("Id of the hub in which the module is")]
            int idHub)
        {
            try
            {
                var currentPupil = _authenticationService.GetCurrentPupil();

                _moduleService.FinishModule(currentPupil.Id, idHub);

                return(NoContent());
            }
            catch (BaseException ex)
            {
                if (ex is UnknownAttendeeException)
                {
                    return(Unauthorized(
                               new UnauthorizedError(ex)));
                }

                return(BadRequest(
                           new BadRequestError(ex)));
            }
        }