Fix ReferenceError: Cannot access 'renderObsList' before initialization by converting arrow functions to standard hoisted functions

This commit is contained in:
2026-05-28 12:03:53 +00:00
parent 66cdf62d9b
commit 4beb018680
2 changed files with 100 additions and 3 deletions
+3 -3
View File
@@ -2387,16 +2387,16 @@ const initApp = () => {
if (obsSearchCrianca) obsSearchCrianca.addEventListener('input', renderObsList);
// Preenche select de meses
const populateMonthFilter = () => {
function populateMonthFilter() {
if (!obsFilterMes) return;
const months = [...new Set(allObservations.map(o => o.date?.slice(0, 7)))]
.filter(Boolean).sort().reverse();
obsFilterMes.innerHTML = '<option value="">Todos os meses</option>' +
months.map(m => `<option value="${m}">${m.split('-')[1]}/${m.split('-')[0]}</option>`).join('');
};
}
// Renderiza lista filtrada
const renderObsList = () => {
function renderObsList() {
if (!obsList) return;
const mes = obsFilterMes?.value || '';
const tag = obsFilterTag?.value || '';