app/controllers/DestinationsController.java
@Security.Authenticated(SecureSession.class)
    public CompletionStage<Result> showDestinationEdit(Http.Request request, Integer destId, boolean isPublic) {
        Integer profId = SessionController.getCurrentUserId(request);
        return profileRepository.findById(profId).thenApplyAsync(profile -> {
            if (profile.isPresent()) {
                destinationsList = loadCurrentUserDestinationPhotos(profId, destinationsList);
                destinationsList = loadWorldDestPhotos(profId, destinationsList);
                destinationsList = loadTravellerTypes(destinationsList);
                List<Photo> usersPhotos = getUsersPhotos(profile.get().getProfileId());
                Destination currentDestination = destinationRepository.lookup(destId);
                destinationTravellerTypeRepository.getDestinationTravellerList(destId).ifPresent(currentDestination::setTravellerTypes);

                RoutedObject<Destination> toSend = new RoutedObject<>(currentDestination, true, false);
                form.fill(currentDestination);
                return ok(destinations.render(destinationsList, profile.get(), isPublic,
                        initialisePaginiation(0, profId, isPublic), followedDestinationIds, usersPhotos, form,
                        toSend, requestForm, Country.getInstance().getAllCountries(), searchForm, searchVal,  request,
                        messagesApi.preferred(request)));
            } else {
                return redirect(destShowRoute);
            }
        });
    }
/**
     * Endpoint method to get a destination object to the view to edit or view
     *
     * @param request the get request sent by the client
     * @param destId  the id of the destination to view
     * @return CompletionStage holding result rendering the admin  page with the desired destination
     * @apiNote GET /admin/destinations/:destId?isEdit
     */
Endpoint method to get a destination object to the view to edit or view
@param request the get request sent by the client
@param destId  the id of the destination to view
@return CompletionStage holding result rendering the admin  page with the desired destination
@apiNote GET /admin/destinations/:destId?isEdit
Endpoint method to get a destination object to the view to edit or view @param request the get request sent by the client @param destId the id of the destination to view @return CompletionStage holding result rendering the admin page with the desired destination @apiNote GET / admin / destinations / : destId?isEdit
@Security.Authenticated(SecureSession.class)
    public CompletionStage<Result> showDestinationEdit(Http.Request request, Integer destId, boolean isPublic) {
        Integer profId = SessionController.getCurrentUserId(request);
        return profileRepository.findById(profId).thenApplyAsync(profile -> {
            if (profile.isPresent()) {
                destinationsList = loadCurrentUserDestinationPhotos(profId, destinationsList);
                destinationsList = loadWorldDestPhotos(profId, destinationsList);
                destinationsList = loadTravellerTypes(destinationsList);
                List<Photo> usersPhotos = getUsersPhotos(profile.get().getProfileId());
                Destination currentDestination = destinationRepository.lookup(destId);
                destinationTravellerTypeRepository.getDestinationTravellerList(destId).ifPresent(currentDestination::setTravellerTypes);
                RoutedObject<Destination> toSend = new RoutedObject<>(currentDestination, true, false);
                form.fill(currentDestination);
                return ok(destinations.render(destinationsList, profile.get(), isPublic,
                        initialisePaginiation(0, profId, isPublic), followedDestinationIds, usersPhotos, form,
                        toSend, requestForm, Country.getInstance().getAllCountries(), searchForm, searchVal,  request,
                        messagesApi.preferred(request)));
            } else {
                return redirect(destShowRoute);
            }
        });
    }
@ Security . Authenticated ( SecureSession . class ) public CompletionStage < Result > showDestinationEdit ( Http . Request request , Integer destId , boolean isPublic ) { Integer profId = SessionController . getCurrentUserId ( request ) ; return profileRepository . findById ( profId ) . thenApplyAsync ( profile -> { if ( profile . isPresent ( ) ) { destinationsList = loadCurrentUserDestinationPhotos ( profId , destinationsList ) ; destinationsList = loadWorldDestPhotos ( profId , destinationsList ) ; destinationsList = loadTravellerTypes ( destinationsList ) ; List < Photo > usersPhotos = getUsersPhotos ( profile . get ( ) . getProfileId ( ) ) ; Destination currentDestination = destinationRepository . lookup ( destId ) ; destinationTravellerTypeRepository . getDestinationTravellerList ( destId ) . ifPresent ( currentDestination :: setTravellerTypes ) ; RoutedObject < Destination > toSend = new RoutedObject < > ( currentDestination , true , false ) ; form . fill ( currentDestination ) ; return ok ( destinations . render ( destinationsList , profile . get ( ) , isPublic , initialisePaginiation ( 0 , profId , isPublic ) , followedDestinationIds , usersPhotos , form , toSend , requestForm , Country . getInstance ( ) . getAllCountries ( ) , searchForm , searchVal , request , messagesApi . preferred ( request ) ) ) ; } else { return redirect ( destShowRoute ) ; } } ) ; }
Endpoint method to get a destination object to the view to edit or view
 @param request the get request sent by the client
 @param destId  the id of the destination to view
 @return CompletionStage holding result rendering the admin  page with the desired destination
 @apiNote GET /admin/destinations/:destId?isEdit
Endpoint method to get a destination object to the view to edit or view @param request the get request sent by the client @param destId the id of the destination to view @return CompletionStage holding result rendering the admin page with the desired destination @apiNote GET / admin / destinations / : destId?isEdit