I have added custom js to create module for a functionality. I need to call ajax in my custom js but I need Base url of admin in js file. How I will get this? I tried
function createBooking(){
orderId =4;
if(orderId ==null){
alert('Order id does not found')
}else{
require(['jquery'], function ($) {
$.ajax({
url: {Here I need admin base url},
type: 'POST',
data: {isAjax: 'true', form_key: FORM_KEY,order_id:orderId}
});
});
} //else
} // createBooking