Skip to content

Commit 820c40f

Browse files
committed
cleaned some code
1 parent 25c6c66 commit 820c40f

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

api/routes/user.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ router.post("/login", (req, res, next) => {
120120
});
121121
});
122122

123-
router.get('/:user', (req, res, next) => {
123+
router.get('/:user', checkAuth, (req, res, next) => {
124124
var user = req.params.user;
125125

126126
User.find({ username: user })
@@ -140,28 +140,6 @@ router.get('/:user', (req, res, next) => {
140140
})
141141
})
142142
.catch(err => res.status(500).json({ err }))
143-
144-
// User.find({ username: user })
145-
// .select('_id username role bio followers following')
146-
// .exec()
147-
// .then(async doc => {
148-
// const Posts = await Post.find();
149-
// const UserData = {
150-
// _id: doc._id,
151-
// username: doc.username,
152-
// role: doc.role,
153-
// bio: doc.bio,
154-
// followers: doc.followers,
155-
// following: doc.following,
156-
// posts: Posts.filter(Post => Post.createdBy.get('username') === doc.username)
157-
// }
158-
// console.log(UserData)
159-
// res.status(200)
160-
161-
// })
162-
// .catch(err => {
163-
// res.status(500).json({ error: err })
164-
// })
165143
});
166144

167145
router.patch('/:userId', checkAuth, (req, res, next) => {

0 commit comments

Comments
 (0)