(function (window, undefined) {
  'use strict';
  let url=location.origin+"/reconvert/";
  const queryString = window.location.search;
  const urlParams = new URLSearchParams(queryString);
 
  /*
  NOTE:
  ------
  PLACE HERE YOUR OWN JAVASCRIPT CODE IF NEEDED
  WE WILL RELEASE FUTURE UPDATES SO IN ORDER TO NOT OVERWRITE YOUR JAVASCRIPT CODE PLEASE CONSIDER WRITING YOUR SCRIPT HERE.  */

 let userDataTable=$(".funnelList").DataTable(
  {
    processing: true,
    serverSide: true,
    ajax: {
        url: url+'admin/api/funnel/list'+queryString,
        type: 'POST',
    },
    columns: [
        { data: 'no' },
        { data: 'title' },
        { data: 'impression' },
        { data: 'revenue' },
        { data: 'status' },
        { data: 'action' },
    ],
  }
 );
 
  $("table").on("click",".deleteFunnel",function(){4
    let href= $(this).attr("data-href");
    $.ajax({
        url : href,
        type: "POST",
        dataType: "json",
        success: function(data, textStatus, jqXHR)
        {
            
            userDataTable.page.len(10).draw();
            shopifypushapp(data.message)
            // swal("Deleted!", "Product Review has been Deleted.", "success");

        },
        error: function (jqXHR, textStatus, errorThrown)
        {
          shopifypushapp(data.message,"warning")
          //swal("Warning!", "Try Again.", "warning");
        }
    });
  })
})(window);
