fix: Date filter now sends both start_date and end_date to filter single day - v1.0.15

This commit is contained in:
2025-11-20 15:06:58 -03:00
parent e3a5fd6686
commit 9dd2e2598b
2 changed files with 7 additions and 3 deletions

View File

@@ -3227,7 +3227,9 @@ function ReportsTab({ user }) {
const API_URL = import.meta.env.VITE_API_URL || ''
let url = `${API_URL}/api/reports/dashboard?`
if (filtersToApply.date) url += `start_date=${filtersToApply.date}&`
if (filtersToApply.date) {
url += `start_date=${filtersToApply.date}&end_date=${filtersToApply.date}&`
}
if (filtersToApply.mechanicId) url += `mechanic_id=${filtersToApply.mechanicId}&`
console.log('Dashboard URL:', url)
@@ -3255,7 +3257,9 @@ function ReportsTab({ user }) {
const API_URL = import.meta.env.VITE_API_URL || ''
let url = `${API_URL}/api/reports/inspections?`
if (filtersToApply.date) url += `start_date=${filtersToApply.date}&`
if (filtersToApply.date) {
url += `start_date=${filtersToApply.date}&end_date=${filtersToApply.date}&`
}
if (filtersToApply.mechanicId) url += `mechanic_id=${filtersToApply.mechanicId}&`
console.log('Inspections URL:', url)