public async Task <IActionResult> FollowTrip(int schoolId, int tripId, int id) { if (await userService.FollowTrip(schoolId, tripId, id)) { var tripFollow = await database.UserRepository.GetTripFollow(tripId, id); if (tripFollow == null) { throw new EntityNotFoundException(); } var tripFollowToReturn = mapper.Map <TripFollowDetailsDto>(tripFollow); await notificationSystem.PushNotification(tripFollow.Trip.School.OwnerId, StaticExpressions.NewTripFollow(tripFollow.User.UserName, tripFollow.Trip.Name)); return(Ok(tripFollowToReturn)); } return(BadRequest("Nie udało się dodać wycieczki do listy ulubionych")); }