fix: change get for orders v2
This commit is contained in:
parent
b8dc15cbc6
commit
1b93a8e2bb
@ -1,13 +1,9 @@
|
|||||||
const router = require('express').Router()
|
const router = require('express').Router()
|
||||||
const { OrderModel } = require('./model/order')
|
const { OrderModel } = require('./model/order')
|
||||||
|
|
||||||
router.get('/orders', async (req, res, next) => {
|
router.post('/orders', async (req, res, next) => {
|
||||||
try {
|
|
||||||
const orders = await OrderModel.find({})
|
const orders = await OrderModel.find({})
|
||||||
res.status(200).send({ success: true, body: orders })
|
res.status(200).send({ success: true, body: orders })
|
||||||
} catch (error) {
|
|
||||||
next(error)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
module.exports = router
|
module.exports = router
|
Loading…
Reference in New Issue
Block a user