From 88a1534eb2fa295da1d275c7bd8dac7805b784e6 Mon Sep 17 00:00:00 2001 From: SDE Date: Tue, 1 Aug 2023 19:41:10 +0300 Subject: [PATCH] 0.0.70 --- static/js/user_profile.js | 12 ++++++------ templates/blocks/profile/b_new_route.html | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) 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 %}
- +