$(document).on('click', '#add-price', function(e) {
   e.preventDefault();
   var button = $(this);
   var lastId = parseInt(button.data('last'))+1;
   var serviceId = button.data('service');

    $.ajax({
        url: '/admin/price/new-price',
        type: "GET",
        data: {
            lastId: lastId,
            service_id: serviceId
        },
        success: function(data) {
            console.log(lastId);
            console.log( button.data('last', lastId));
            lastId = button.attr('data-last', lastId);
            button.parent().parent().before(data);

        },
        error: function(data) {
        }
    });


});

$(document).on('click', '.delete-url', function(e){
    e.preventDefault();
    $(this).parent().parent().remove();
});
