diff --git a/app/__pycache__/views.cpython-311.pyc b/app/__pycache__/views.cpython-311.pyc index 731a4837c..36d7068f0 100644 Binary files a/app/__pycache__/views.cpython-311.pyc and b/app/__pycache__/views.cpython-311.pyc differ diff --git a/app/templates/elements/Scripts/volumeUpdate.html b/app/templates/elements/Scripts/volumeUpdate.html index 0f0c610f4..de25f0889 100644 --- a/app/templates/elements/Scripts/volumeUpdate.html +++ b/app/templates/elements/Scripts/volumeUpdate.html @@ -9,7 +9,7 @@ $.ajax({ url: 'mitralVolumeChange/', // Replace with your backend endpoint method: 'POST', - data: {'csrfmiddlewaretoken': '{{ csrf_token }}', value: rangeValue}, // Send the range value as data + data: {'csrfmiddlewaretoken': '{{ csrf_token }}', identifier:'normal_heart', rangeValue: rangeValue}, // Send the range value as data success: function (response) { // Handle success response console.log('POST request successful:', response); diff --git a/app/views.py b/app/views.py index 144825721..5af841145 100644 --- a/app/views.py +++ b/app/views.py @@ -9,6 +9,7 @@ import io import threading import time +import os from .models import heartAudio, lungAudio from .forms import heartAudioForms, lungAudioForm @@ -114,7 +115,40 @@ def breathUpdate(request): def mitralVolumeChange(request): if request.method == 'POST': - print('Range value transfer successful') + if request.POST['identifier'] == 'normal_heart': + volume = request.POST['rangeValue'] + return JsonResponse({'message': 'Success!'}) + else: + return HttpResponse("Request method is not a POST") + +def aorticVolumeChange(request): + if request.method == 'POST': + if request.POST['identifier'] == 'normal_heart': + volume = request.POST['rangeValue'] + return JsonResponse({'message': 'Success!'}) + else: + return HttpResponse("Request method is not a POST") + +def pulmonaryVolumeChange(request): + if request.method == 'POST': + if request.POST['identifier'] == 'normal_heart': + volume = request.POST['rangeValue'] + return JsonResponse({'message': 'Success!'}) + else: + return HttpResponse("Request method is not a POST") + +def tricuspidVolumeChange(request): + if request.method == 'POST': + if request.POST['identifier'] == 'normal_heart': + volume = request.POST['rangeValue'] + return JsonResponse({'message': 'Success!'}) + else: + return HttpResponse("Request method is not a POST") + +def erbVolumeChange(request): + if request.method == 'POST': + if request.POST['identifier'] == 'normal_heart': + volume = request.POST['rangeValue'] return JsonResponse({'message': 'Success!'}) else: return HttpResponse("Request method is not a POST") diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index fb90ec1d3..59a088412 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/urls.py b/core/urls.py index 30d0d1ab1..8eebf9613 100644 --- a/core/urls.py +++ b/core/urls.py @@ -26,6 +26,10 @@ path('heartUpdate/', heartUpdate), path('breathUpdate/', breathUpdate), path('mitralVolumeChange/', mitralVolumeChange), + path('aorticVolumeChange/', aorticVolumeChange), + path('pulmonaryVolumeChange/', pulmonaryVolumeChange), + path('tricuspidVolumeChange/', tricuspidVolumeChange), + path('erbVolumeChange/', erbVolumeChange), path('django_plotly_dash/', include('django_plotly_dash.urls')), ]