Finish implementation of Hazard list so it can handle when hazards end

This commit is contained in:
mrkmntal 2026-04-16 18:32:53 -04:00
commit 92822e2ddc
3 changed files with 21 additions and 11 deletions

View file

@ -307,17 +307,17 @@ if (!process.env?.STATIC) {
app.post('/api/hazard-history', async (req, res) => {
try {
const { location, hazards } = req.body;
const { location, locationKey, hazards } = req.body;
if (!location || !Array.isArray(hazards)) {
if (!location || !locationKey || !Array.isArray(hazards)) {
res.status(400).json({
success: false,
error: 'Missing or invalid location/hazards',
error: 'Missing or invalid location/locationKey/hazards',
});
return;
}
const history = await updateHistory({ location, hazards });
const history = await updateHistory({ location, locationKey, hazards });
res.json({
success: true,
history,