app/controllers/DestinationsController.java
@Security.Authenticated(SecureSession.class)
    public CompletionStage<Result> linkPhotoToDestination(Http.Request request, Integer photoId, Integer destinationId) {
        Integer userId = SessionController.getCurrentUserId(request);
        DestinationPhoto destinationPhoto = new DestinationPhoto(userId, photoId, destinationId);
        return destinationPhotoRepository.insert(destinationPhoto).thenApplyAsync(result -> {
            if (result.isPresent()) {
                return redirect(destShowRoute).flashing("success", "Photo was successfully linked to destination");
            }
            return redirect(destShowRoute).flashing("failure", "Photo was unsuccessfully linked to destination");
        });
    }
/**
     * Method to link photo to a given destination
     *
     * @param photoId       Id of the photo to be linked
     * @param destinationId Id of the destination that needs to be linked to a photo
     * @return completion stage result redirected to destination
     */
Method to link photo to a given destination
@param photoId       Id of the photo to be linked
@param destinationId Id of the destination that needs to be linked to a photo
@return completion stage result redirected to destination
Method to link photo to a given destination @param photoId Id of the photo to be linked @param destinationId Id of the destination that needs to be linked to a photo @return completion stage result redirected to destination
@Security.Authenticated(SecureSession.class)
    public CompletionStage<Result> linkPhotoToDestination(Http.Request request, Integer photoId, Integer destinationId) {
        Integer userId = SessionController.getCurrentUserId(request);
        DestinationPhoto destinationPhoto = new DestinationPhoto(userId, photoId, destinationId);
        return destinationPhotoRepository.insert(destinationPhoto).thenApplyAsync(result -> {
            if (result.isPresent()) {
                return redirect(destShowRoute).flashing("success", "Photo was successfully linked to destination");
            }
            return redirect(destShowRoute).flashing("failure", "Photo was unsuccessfully linked to destination");
        });
    }
@ Security . Authenticated ( SecureSession . class ) public CompletionStage < Result > linkPhotoToDestination ( Http . Request request , Integer photoId , Integer destinationId ) { Integer userId = SessionController . getCurrentUserId ( request ) ; DestinationPhoto destinationPhoto = new DestinationPhoto ( userId , photoId , destinationId ) ; return destinationPhotoRepository . insert ( destinationPhoto ) . thenApplyAsync ( result -> { if ( result . isPresent ( ) ) { return redirect ( destShowRoute ) . flashing ( "success" , "Photo was successfully linked to destination" ) ; } return redirect ( destShowRoute ) . flashing ( "failure" , "Photo was unsuccessfully linked to destination" ) ; } ) ; }
Method to link photo to a given destination
 @param photoId       Id of the photo to be linked
 @param destinationId Id of the destination that needs to be linked to a photo
 @return completion stage result redirected to destination
Method to link photo to a given destination @param photoId Id of the photo to be linked @param destinationId Id of the destination that needs to be linked to a photo @return completion stage result redirected to destination