public async Task <IActionResult> GetPassengersByRideAsync(int rideId) { var userDto = await _userLogic.GetLoggedInUser(); await ValidateDriverAsync(rideId); IEnumerable <PassengerDto> passengers = _rideLogic.GetPassengersByRideId(rideId); return(Ok(passengers)); }
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)); }
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)); }