mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-29 08:07:48 +01:00
get users
This commit is contained in:
@@ -11,6 +11,16 @@ const auth = require('./auth');
|
||||
|
||||
const { NotFoundError } = require('../errors');
|
||||
|
||||
router.get(
|
||||
'/user',
|
||||
auth.required,
|
||||
asyncHelper(async (req, res) => {
|
||||
const { id } = req.user;
|
||||
const user = await User.findById(id).exec();
|
||||
res.json({ success: true, data: user.toJson() });
|
||||
}),
|
||||
);
|
||||
|
||||
router.post(
|
||||
'/',
|
||||
asyncHelper(async (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user