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(), {