You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
485 B
JavaScript

const router = module.exports = require('express-promise-router')()
const parseJSON = require('body-parser').json()
const db = require('../db')
const validate = require('./middleware/validators')
router.use(require('./middleware/ensureCart'))
router.put('/', async (req, res) => {
const order = await db.order.create(req.cart.uuid);
res.json(order)
})
router.get('/current', async (req, res) => {
const order = await db.order.findForCart(req.cart.uuid);
res.json(order)
})