i have a function that contain 2 $.ajax functions with different actions but using same data i put these data inside an object, how to add different action to every $.ajax function
it's mandatory to use same data inside an object
var request_data = {
nonce: ajax_object.nonce,
category_id: cat_ids,
brand_name: brand_name_value,
orderby_meta_key: orderby_meta_key,
orderby: orderby,
order_type: order_type,
shop_view: shop_view
}
function ajax_filter(){
// firest ajax function
$.ajax( {
url: ajax_object.ajax_url,
type: 'post',
action:'shop_filter', ------> //not working like this
data: request_data,
success: function(feedback) {
}
})
// second ajax function
$.ajax( {
url: ajax_object.ajax_url,
type: 'post',
action: 'update_another_function', ----> //not working like this
cache: true,
data: request_data,
success: function(feedback) {
},
})
}