diff --git a/static/js/user_profile.js b/static/js/user_profile.js index a9ab1f0..2be7302 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -229,13 +229,12 @@ function onblurInputField(event,el){ function sendRoute(el, routeID = null){ event.preventDefault() - let route_obj = { - 'route_id': routeID - } let form = el.form; let formData = new FormData(form); - let data = new Object([route_obj, formData]) - + let add_url = '' + if (routeID !== null){ + add_url = routeID + } $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, @@ -246,7 +245,7 @@ function sendRoute(el, routeID = null){ processData: false, contentType: false, // enctype: 'json', - data: JSON.stringify(data), + data: formData, success: function(data){ console.log('data received') // location.href = '/profile' @@ -274,6 +273,7 @@ function sendRoute(el, routeID = null){ + //cleaning route inputs after selection changes function OnSelectionChange(el) { event.preventDefault() diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index 2ac3940..1997534 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -295,7 +295,7 @@ {% endif %}
- +