diff --git a/server.js b/server.js index ec03429..236fbf2 100644 --- a/server.js +++ b/server.js @@ -113,13 +113,13 @@ app.post('/api/admin/login', (req, res) => { } }); -// Get all active locations (within 48 hours) +// Get all active locations (within 48 hours OR persistent) app.get('/api/locations', (req, res) => { console.log('Fetching active locations'); const fortyEightHoursAgo = new Date(Date.now() - 48 * 60 * 60 * 1000).toISOString(); db.all( - 'SELECT * FROM locations WHERE created_at > ? ORDER BY created_at DESC', + 'SELECT * FROM locations WHERE created_at > ? OR persistent = 1 ORDER BY created_at DESC', [fortyEightHoursAgo], (err, rows) => { if (err) { @@ -127,7 +127,7 @@ app.get('/api/locations', (req, res) => { res.status(500).json({ error: 'Internal server error' }); return; } - console.log(`Fetched ${rows.length} active locations`); + console.log(`Fetched ${rows.length} active locations (including persistent)`); res.json(rows); } );