From 88b80bc750b02de9ea3a4575ee893d9276074d77 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 16 Jul 2025 18:38:29 -0600 Subject: [PATCH] bug fixes for shifts functionality --- map/app/controllers/shiftsController.js | 3 ++- map/files-explainer.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/map/app/controllers/shiftsController.js b/map/app/controllers/shiftsController.js index f1617d1..610b802 100644 --- a/map/app/controllers/shiftsController.js +++ b/map/app/controllers/shiftsController.js @@ -160,8 +160,9 @@ class ShiftsController { // Calculate current volunteers dynamically let currentVolunteers = 0; + let allSignups = { list: [] }; // Initialize with empty list if (config.nocodb.shiftSignupsSheetId) { - const allSignups = await nocodbService.getAll(config.nocodb.shiftSignupsSheetId); + allSignups = await nocodbService.getAll(config.nocodb.shiftSignupsSheetId); const confirmedSignups = (allSignups.list || []).filter(signup => signup['Shift ID'] === parseInt(shiftId) && signup.Status === 'Confirmed' ); diff --git a/map/files-explainer.md b/map/files-explainer.md index efefe38..63e045a 100644 --- a/map/files-explainer.md +++ b/map/files-explainer.md @@ -44,7 +44,7 @@ Controller for application settings, start location, and walk sheet config. # app/controllers/shiftsController.js -Controller for volunteer shift management (public and admin). When users sign up for shifts, the signup record includes the shift title for better tracking and display. +Controller for volunteer shift management (public and admin). When users sign up for shifts, the signup record includes the shift title for better tracking and display. Fixed variable scope issue in signup method to prevent "allSignups is not defined" error. # app/controllers/usersController.js