Wander function not working
gregallensworth opened this issue · 6 comments
The Wander link is not working.
Seems the API is trying to find a random park which had a photo within the last month:
caliparks.org/app/server/server.js
Line 354 in a15ab39
See what could be done to remove the "last month" filter, and return a random park? Performance shouldn't be bad.
Though Sean follows up, that perhaps it's not using that interval but a hardcoded one:
Then follows up, that one needs to change these lines:
I probably meant to use the interval option but never got around to implementing it, sorry :-(
The "wander" button on the home page actually routes to "/wander" then redirects to parks page.
caliparks.org/app/server/server.js
Lines 224 to 232 in a15ab39
Currently it's not even hitting the express route as it's missing a route in routes.jsx
:
caliparks.org/app/public/routes.jsx
Lines 12 to 27 in a15ab39
Actually I see it doesn't need a route, as the Nav component creates the link. Slightly confusing that routes for /discover
and /explore
point to the 404 page and that /wander
was missing from Routes.jsx
. The first two should probably redirect to the home page as /#discover
and /#explore
, although when you refresh the page with either of those in URL it doesn't scroll to the correct section, but that's another issue.
Fixed the SQL query by removing the WHERE clause on the SELECT * FROM instagram_photos
and tacking on a LIMIT 500
as to not grab millions of photos. There's probably a better way to make the query return rows that are more randomized.
I just tried this on live site and I'm still getting 404 when I click on or load http://www.caliparks.org/wander
Does this fix still need to be deployed?