Commit 87f0d0a6 authored by baesangjune's avatar baesangjune
Browse files

채린아 고마워

parent 2e335d43
...@@ -81,17 +81,18 @@ const getReview = async (link) => { ...@@ -81,17 +81,18 @@ const getReview = async (link) => {
} }
const find = (req, res, next) => { const find = (req, res, next) => {
console.log("7", req.body) res.send("안녕")
if (req.body.db) { // console.log("7", req.body)
next() // if (req.body.db) {
} // next()
Review.find({ keyword:{ $elemMatch: res.query.keyword } }, function (err, reviews) { // }
if (reviews) { // Review.find({ keyword:{ $elemMatch: res.query.keyword } }, function (err, reviews) {
if (reviews.length > 10) // if (reviews) {
res.send(reviews, { db: true }) // if (reviews.length > 10)
req.reviews = reviews // res.send(reviews, { db: true })
} // req.reviews = reviews
next() // }
}) // next()
// })
} }
export default { search, find } export default { search, find }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment