app/controllers/DestinationsController.java
@Security.Authenticated(SecureSession.class)
    public CompletionStage<Result> follow(Http.Request request, Integer profileId, int destId, boolean isPublic) {
        Integer profId = SessionController.getCurrentUserId(request);
        return profileRepository.findById(profId).thenApplyAsync(profile -> {
            if (profile.isPresent()) {
                destinationRepository.followDestination(destId, profileId).ifPresent(ids -> followedDestinationIds = ids);
                destinationsList = loadCurrentUserDestinationPhotos(profileId, destinationsList);
                destinationsList = loadWorldDestPhotos(profileId, destinationsList);
                destinationsList = loadTravellerTypes(destinationsList);
                List<Photo> usersPhotos = getUsersPhotos(profile.get().getProfileId());
                return ok(destinations.render(destinationsList, profile.get(), isPublic,
                        initialisePaginiation(0, profileId, isPublic), followedDestinationIds, usersPhotos,
                        form, new RoutedObject<Destination>(null, false, false), requestForm,
                        Country.getInstance().getAllCountries(), searchForm, searchVal,   request, messagesApi.preferred(request)));
            } else {
                return redirect(destShowRoute);
            }
        });
    }
/**
     * Method to follow a destination called from the destinations page and used from an endpoint
     *
     * @param profileId Id of the profile to follow destination
     * @param destId    Id of the destination to be followed
     * @param isPublic  Boolean of the destination if is public or not
     */
Method to follow a destination called from the destinations page and used from an endpoint
@param profileId Id of the profile to follow destination
@param destId    Id of the destination to be followed
@param isPublic  Boolean of the destination if is public or not
Method to follow a destination called from the destinations page and used from an endpoint @param profileId Id of the profile to follow destination @param destId Id of the destination to be followed @param isPublic Boolean of the destination if is public or not
@Security.Authenticated(SecureSession.class)
    public CompletionStage<Result> follow(Http.Request request, Integer profileId, int destId, boolean isPublic) {
        Integer profId = SessionController.getCurrentUserId(request);
        return profileRepository.findById(profId).thenApplyAsync(profile -> {
            if (profile.isPresent()) {
                destinationRepository.followDestination(destId, profileId).ifPresent(ids -> followedDestinationIds = ids);
                destinationsList = loadCurrentUserDestinationPhotos(profileId, destinationsList);
                destinationsList = loadWorldDestPhotos(profileId, destinationsList);
                destinationsList = loadTravellerTypes(destinationsList);
                List<Photo> usersPhotos = getUsersPhotos(profile.get().getProfileId());
                return ok(destinations.render(destinationsList, profile.get(), isPublic,
                        initialisePaginiation(0, profileId, isPublic), followedDestinationIds, usersPhotos,
                        form, new RoutedObject<Destination>(null, false, false), requestForm,
                        Country.getInstance().getAllCountries(), searchForm, searchVal,   request, messagesApi.preferred(request)));
            } else {
                return redirect(destShowRoute);
            }
        });
    }
@ Security . Authenticated ( SecureSession . class ) public CompletionStage < Result > follow ( Http . Request request , Integer profileId , int destId , boolean isPublic ) { Integer profId = SessionController . getCurrentUserId ( request ) ; return profileRepository . findById ( profId ) . thenApplyAsync ( profile -> { if ( profile . isPresent ( ) ) { destinationRepository . followDestination ( destId , profileId ) . ifPresent ( ids -> followedDestinationIds = ids ) ; destinationsList = loadCurrentUserDestinationPhotos ( profileId , destinationsList ) ; destinationsList = loadWorldDestPhotos ( profileId , destinationsList ) ; destinationsList = loadTravellerTypes ( destinationsList ) ; List < Photo > usersPhotos = getUsersPhotos ( profile . get ( ) . getProfileId ( ) ) ; return ok ( destinations . render ( destinationsList , profile . get ( ) , isPublic , initialisePaginiation ( 0 , profileId , isPublic ) , followedDestinationIds , usersPhotos , form , new RoutedObject < Destination > ( null , false , false ) , requestForm , Country . getInstance ( ) . getAllCountries ( ) , searchForm , searchVal , request , messagesApi . preferred ( request ) ) ) ; } else { return redirect ( destShowRoute ) ; } } ) ; }
Method to follow a destination called from the destinations page and used from an endpoint
 @param profileId Id of the profile to follow destination
 @param destId    Id of the destination to be followed
 @param isPublic  Boolean of the destination if is public or not
Method to follow a destination called from the destinations page and used from an endpoint @param profileId Id of the profile to follow destination @param destId Id of the destination to be followed @param isPublic Boolean of the destination if is public or not