app/controllers/DestinationsController.java
public CompletionStage<Result> delete(Http.Request request, Integer id) {
        return destinationRepository.checkDestinationExists(id).thenApplyAsync(result -> {
            if (result) {
                return redirect(destShowRoute).flashing("failure", "Destination: " + id +
                        " is used within trips, treasure hunts or events");
            }
            destinationRepository.delete(id);
            return redirect(destShowRoute).flashing("success", "Destination: " + id + " deleted");
        });
    }
/**
     * Deletes a destination in the database
     * @param request HTTP Request
     * @param id ID of the destination to delete
     * @return a redirect to the destinations page
     */
Deletes a destination in the database
@param request HTTP Request
@param id ID of the destination to delete
@return a redirect to the destinations page
Deletes a destination in the database @param request HTTP Request @param id ID of the destination to delete @return a redirect to the destinations page
public CompletionStage<Result> delete(Http.Request request, Integer id) {
        return destinationRepository.checkDestinationExists(id).thenApplyAsync(result -> {
            if (result) {
                return redirect(destShowRoute).flashing("failure", "Destination: " + id +
                        " is used within trips, treasure hunts or events");
            }
            destinationRepository.delete(id);
            return redirect(destShowRoute).flashing("success", "Destination: " + id + " deleted");
        });
    }
public CompletionStage < Result > delete ( Http . Request request , Integer id ) { return destinationRepository . checkDestinationExists ( id ) . thenApplyAsync ( result -> { if ( result ) { return redirect ( destShowRoute ) . flashing ( "failure" , "Destination: " + id + " is used within trips, treasure hunts or events" ) ; } destinationRepository . delete ( id ) ; return redirect ( destShowRoute ) . flashing ( "success" , "Destination: " + id + " deleted" ) ; } ) ; }
Deletes a destination in the database
 @param request HTTP Request
 @param id ID of the destination to delete
 @return a redirect to the destinations page
Deletes a destination in the database @param request HTTP Request @param id ID of the destination to delete @return a redirect to the destinations page