Skip to content

Commit

Permalink
Add nameAndEmail api call
Browse files Browse the repository at this point in the history
  • Loading branch information
Jneville0815 committed Jan 5, 2024
1 parent b56d7a0 commit 2317e36
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions routes/userInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ router.get('/:id', verify, async (req, res) => {
res.send(user)
})

router.get('/:id/emailAndName', verify, async (req, res) => {
const user = await User.findOne(
{ _id: req.params.id },
{ password: 0 } // don't retrieve password
)
res.send({name: user.name, email: user.email})
})

router.get('/:id/fitness', verify, async (req, res) => {
const user = await User.findOne({ _id: req.params.id })

Expand Down

0 comments on commit 2317e36

Please sign in to comment.