Skip to content

Commit

Permalink
Merge pull request #137 from spectatorpublishing/filtersDB
Browse files Browse the repository at this point in the history
Filters db
  • Loading branch information
TannerTreasure authored Mar 1, 2021
2 parents 5048f4f + 9b9de4a commit 7342764
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
6 changes: 5 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@
"last 1 firefox version",
"last 1 safari version"
]
}
},
"main": "index.js",
"author": "",
"license": "ISC",
"description": ""
}
1 change: 1 addition & 0 deletions client/src/containers/FAQ.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const Title = styled.div`


export const FAQ = () => {

return(
<PageWrapper>
<Title>Frequently Asked Questions</Title>
Expand Down
13 changes: 11 additions & 2 deletions server/controllers/clubProfileController.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,18 @@ module.exports = {
},
filterAndSortBy: function(req, res) {
// TODO; req.query contains filter and/or sort information
// support pagination with req.query


clubProfile.find({
memberRange: {$in: req.query.memberRange},
tags: {$in: req.query.tags},
acceptingMembers: req.query.acceptingMembers,
applicationRequired: req.query.applicationRequired
}).then(clubprofile => res.json(clubprofile)
).catch(err => errHandling(err, res));

},


search: function(req, res) {
// TODO; req.query contains search query
// support pagination with req.query
Expand Down
2 changes: 1 addition & 1 deletion server/routes/clubProfileRoutes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const clubProfileControllers = require('../controllers/clubProfileController')
const router = require('express').Router()

router.route("/filterAndSort").get(clubProfileControllers.filterAndSortBy)
router.route("/filterAndSortBy").get(clubProfileControllers.filterAndSortBy)
router.route("/search").get(clubProfileControllers.search)
router.route("/:id").get(clubProfileControllers.getById)
router.route("/").get(clubProfileControllers.getAll)
Expand Down

0 comments on commit 7342764

Please sign in to comment.