Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. componentDidMount() {
  2. api('/profile').get().then(data => {
  3. console.log('/profile data', data)
  4. })
  5. }
  6.  
  7. app.get('/profile', (req, res) => {
  8. if (req.user) {
  9. db.Favorite.find({ uid: req.user._id }).then(user => {
  10. return res.status(200).json(user)
  11. })
  12. } else {
  13. return res.status(403).json({ message: 'you are not logged in' })
  14. }
  15. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement