From 95cc506abf0e71c420b8bfe743635e09fe02d2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Mon, 18 Aug 2025 00:48:16 +0200 Subject: [PATCH] poprawka w suwaku --- static/js/expense_chart.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/js/expense_chart.js b/static/js/expense_chart.js index 77f830d..58d69cd 100644 --- a/static/js/expense_chart.js +++ b/static/js/expense_chart.js @@ -9,10 +9,14 @@ document.addEventListener("DOMContentLoaded", function () { function loadExpenses(range = "last30days", startDate = null, endDate = null) { let url = '/expenses_data?range=' + range; + const showAllCheckbox = document.getElementById("showAllLists"); - if (showAllCheckbox && showAllCheckbox.checked) { + if (showAllCheckbox) { + url += showAllCheckbox.checked ? '&show_all=true' : '&show_all=false'; + } else { url += '&show_all=true'; - } + } + if (startDate && endDate) { url += `&start_date=${startDate}&end_date=${endDate}`; }