fix: change get for orders v2

This commit is contained in:
Ильназ 2025-01-19 10:23:48 +03:00
parent b8dc15cbc6
commit 1b93a8e2bb

View File

@ -1,13 +1,9 @@
const router = require('express').Router()
const { OrderModel } = require('./model/order')
router.get('/orders', async (req, res, next) => {
try {
router.post('/orders', async (req, res, next) => {
const orders = await OrderModel.find({})
res.status(200).send({ success: true, body: orders })
} catch (error) {
next(error)
}
})
module.exports = router
module.exports = router