backoffice: fix URL used for autocomplete criterias on statistics pages (#53848)

This commit is contained in:
Frédéric Péters 2021-05-07 14:07:01 +02:00
parent e8a234da11
commit e05865b1cd
1 changed files with 2 additions and 2 deletions

View File

@ -180,7 +180,7 @@ $(document).on('backoffice-filter-change', function(event, listing_settings) {
$('[data-refresh-options]').each(function(idx, elem) {
var $select = $(elem);
var current_value = $select.val();
var filter_path = pathname + 'filter-options?filter_field_id=' + $(elem).data('refresh-options') + '&' + listing_settings.qs;
var filter_path = pathname.replace(/stats$/, '') + 'filter-options?filter_field_id=' + $(elem).data('refresh-options') + '&' + listing_settings.qs;
$.ajax({
url: filter_path,
success: function(data) {
@ -300,7 +300,7 @@ $(function() {
minimumInputLength: 1,
ajax: {
url: function() {
var pathname = window.location.pathname.replace(/^\/+/, '/');
var pathname = window.location.pathname.replace(/^\/+/, '/').replace(/stats$/, '');
var filter_settings = $('form#listing-settings').serialize();
return pathname + 'filter-options?filter_field_id=' + filter_field_id + '&' + filter_settings;
},