fix routing options updating no 2

This commit is contained in:
Gwendolyn 2023-12-21 01:59:28 +01:00
parent a3185bcb55
commit ff91594b19

View file

@ -506,7 +506,7 @@ c3nav = {
c3nav_api.post('routing/route', { c3nav_api.post('routing/route', {
origin: origin.id, origin: origin.id,
destination: destination.id, destination: destination.id,
...(c3nav.next_route_options || {}), options_override: c3nav.next_route_options ?? null,
}) })
.then(data => c3nav._route_loaded(data, nofly)) .then(data => c3nav._route_loaded(data, nofly))
.catch(data => c3nav._route_loaded({error: `Error ${data.status}`})); .catch(data => c3nav._route_loaded({error: `Error ${data.status}`}));
@ -811,9 +811,7 @@ c3nav = {
c3nav.update_state(null, null, null, false); c3nav.update_state(null, null, null, false);
}, },
_route_options_submit: function () { _route_options_submit: function () {
var options = { var options = {};
'csrfmiddlewaretoken': c3nav.get_csrf_token()
};
$('#route-options').find('.route-options-fields [name]').each(function() { $('#route-options').find('.route-options-fields [name]').each(function() {
options[$(this).attr('name')] = $(this).val(); options[$(this).attr('name')] = $(this).val();
}); });