From 7305f1a3469431d18f603e84d5aa25d32574f871 Mon Sep 17 00:00:00 2001 From: Vyacheslav Shaganov Date: Thu, 12 Dec 2024 21:25:40 +0300 Subject: [PATCH] profile: rating filter added --- frontend/profile.html | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/profile.html b/frontend/profile.html index 6092b44..76d718c 100644 --- a/frontend/profile.html +++ b/frontend/profile.html @@ -40,10 +40,13 @@
Посещённые дворы
+
+ + +
+
- -
@@ -62,13 +65,19 @@
Посещённые дворы
function filterVisits() { const startDate = document.querySelector("input[name='start_date']").value; const endDate = document.querySelector("input[name='end_date']").value; + const ratingFrom = document.querySelector("input[name='courtyard_rating_from']").value; + const ratingTo = document.querySelector("input[name='courtyard_rating_to']").value; const courtyard = document.querySelector("input[name='courtyard']").value; - const data = { + let data = { visited_from: startDate, visited_to: endDate, courtyard_title: courtyard }; + if (ratingFrom) + data.courtyard_rating_from = ratingFrom; + if (ratingTo) + data.courtyard_rating_to = ratingTo; // visits fetch(`http://localhost:8081/users/${id}/visits?` + new URLSearchParams(data).toString(), {