user.routes.js 656 Bytes
Newer Older
Lee SeoYeon's avatar
.    
Lee SeoYeon committed
1
2
import express from "express"
import userCtrl from "../controllers/user.controller.js"
Lee SeoYeon's avatar
0111    
Lee SeoYeon committed
3
4
5
6
7

const router = express.Router()

router.route('/api/users/signup')
        .post(userCtrl.signup)
Lee SeoYeon's avatar
.    
Lee SeoYeon committed
8
        
Lee SeoYeon's avatar
0111    
Lee SeoYeon committed
9
10
router.param('userId', userCtrl.userById)

Lee SeoYeon's avatar
.    
Lee SeoYeon committed
11
12
13
14
15
16
17
18
19
20
router.get('/admin/:_id', verifyToken, function (req, res, next) {
        console.log('/reserves/admin get req.params', req.params)
        Reserve.find({ approve: false }).populate('user').exec(function (err, reserve) {
          if (err) return res.status(500).json({ error: err });
          console.log('reserve list', reserve)
          res.status(201).json(reserve);
        })
      });


Lee SeoYeon's avatar
0111    
Lee SeoYeon committed
21
export default router