示例#1
0
        public async Task <IActionResult> GetPassengersByRideAsync(int rideId)
        {
            var userDto = await _userLogic.GetLoggedInUser();

            await ValidateDriverAsync(rideId);

            IEnumerable <PassengerDto> passengers = _rideLogic.GetPassengersByRideId(rideId);

            return(Ok(passengers));
        }
示例#2
0
        public async Task <IActionResult> GetPassengersByRideAsync(int rideId)
        {
            var userDto = await _userRepository.GetLoggedInUser(User);

            if (!_rideLogic.DoesUserBelongsToRide(userDto.Email, rideId))
            {
                return(Unauthorized());
            }

            IEnumerable <PassengerDto> passengers = _rideLogic.GetPassengersByRideId(rideId);

            return(Ok(passengers));
        }
示例#3
0
        public async Task <IActionResult> GetPassengersByRideAsync(int rideId)
        {
            var userDto = await _userRepository.GetLoggedInUser(User);

            if (!_rideLogic.DoesUserBelongsToRide(userDto.Email, rideId))
            {
                BadRequest("You don't belong to this ride");
            }

            IEnumerable <PassengerDto> passengers = _rideLogic.GetPassengersByRideId(rideId);

            return(Ok(passengers));
        }