Closed Beacon24 closed 2 years ago
Fixed. Problem was with routing, I had two GET
requests going to the same /explore route. I added a /explore/search
route and changed the search form action to /explore/search
, and now the request goes through.
I am trying to set up a keyword search for all users, initiatives, and groups in the database. I am doing this through a route named
explore
.explore.search
(defined in theexplore.js
controller file) is triggered by a submitted formGET
request inviews/explore/index
, but when Iconsole.log(req.params)
I only get{}
.I am also uncertain as to how I can convert the input from the explore
index.ejs
form into an array of 'keywords' to feed intodb.<collectionName>.find({})
.This is my first time trying to execute a
find()
command through an input search, so I'm sure I have made many mistakes.UPDATE: I am wondering if my form submission is properly routed, I tried a
console.log('test')
to see if the explore.search function (in the controller file) was even triggering, and did not get the proper print-out when I submitted the form.