Skip to content

Commit

Permalink
Listando pelo dono
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusCoxxxta committed May 26, 2020
1 parent 58f3be1 commit f916c6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Controllers/PetController.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Pet = mongoose.model('Pet')

module.exports = {
async index (req, res) {
const pets = await Pet.find().sort({ 'createdAt': -1 })
const pets = await Pet.find({ ownerId: req.params.ownerId }).sort({ 'createdAt': -1 })

return res.json(pets)
},
Expand Down

0 comments on commit f916c6a

Please sign in to comment.