Select2 throws an error on ajax call

What I am doing is:

jQuery(function () {

    jQuery("#make").select2({
        allowClear : true,
        placeholder : "Make",
        ajax: {
            url: my_ajax_object.ajax_url,
            data : {
                action: "get_data"
            },
            success: function (res) {
                alert(res)
            }
        }
    })

})

Select 2 is rendered good, but when I open it it throws an error in the console: Uncaught TypeError: data.call is not a function

In functions.php I have the get_data function like this:

function my_enqueue() {
    wp_enqueue_script( 'ajax-script', get_template_directory_uri() . '-child/js/select2.js', array('jquery') );
    wp_localize_script( 'ajax-script', 'my_ajax_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
}
add_action( 'wp_enqueue_scripts', 'my_enqueue' );

function get_data() {
    echo 1;
    wp_die();
}
add_action( 'wp_ajax_nopriv_get_data', 'get_data' );
add_action( 'wp_ajax_get_data', 'get_data' );

I think the things are pretty straight forward but if you want me to provide some more info, please let me know. Thank you!