Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- componentDidMount() {
- api('/profile').get().then(data => {
- console.log('/profile data', data)
- })
- }
- app.get('/profile', (req, res) => {
- if (req.user) {
- db.Favorite.find({ uid: req.user._id }).then(user => {
- return res.status(200).json(user)
- })
- } else {
- return res.status(403).json({ message: 'you are not logged in' })
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement