2024-12-21 21:33:07 +03:00
|
|
|
const router = require('express').Router()
|
2025-01-18 23:02:45 +03:00
|
|
|
const { OrderModel } = require('./model/order')
|
2024-12-21 21:33:07 +03:00
|
|
|
|
2025-01-18 23:02:45 +03:00
|
|
|
router.get('/orders', async (req, res, next) => {
|
|
|
|
try {
|
|
|
|
const orders = await OrderModel.find({})
|
|
|
|
res.status(200).send({ success: true, body: orders })
|
|
|
|
} catch (error) {
|
|
|
|
next(error)
|
|
|
|
}
|
2024-12-21 21:33:07 +03:00
|
|
|
})
|
|
|
|
|
2025-01-18 23:02:45 +03:00
|
|
|
module.exports = router
|