Skip to content

Commit

Permalink
fixed and updated failing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nikiwycherley committed Aug 7, 2024
1 parent 97c4a51 commit 4d870bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion server/routes/station.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ module.exports = {
return h.view('station', { model })
}

const hasForecast = forecastFlag.display_time_series

// Check if it's a forecast station
if (forecastFlag.display_time_series && station.status !== 'Suspended') {
if (hasForecast && station.status !== 'Suspended') {
// Forecast station
const values = await request.server.methods.flood.getStationForecastData(station.wiski_id)
const forecast = { forecastFlag, values }
Expand Down
2 changes: 1 addition & 1 deletion server/services/server-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module.exports = server => {
server.method('flood.getForecastFlag', floodServices.getForecastFlag, {
cache: {
cache: cacheType,
expiresIn: minutes(expiresIn15),
expiresIn: minutes(1),
generateTimeout: seconds(10)
}
})
Expand Down

0 comments on commit 4d870bb

Please sign in to comment.