All files / src/routes/orders_routes orders_getUserOrders_get.js

100% Statements 3/3
75% Branches 3/4
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10          2x 2x 2x    
import OrdersControllers from "../../controllers/orders-controllers/OrdersControllers.js";
import asyncRouteHandler from "../../utilities/asyncRouteHandler.js";
 
export default asyncRouteHandler(
    async function orders_getUserOrders_get(req, res) {
        const orders = await OrdersControllers.getOrders({ userId: req.userId }, req.query)
        orders && res.status(200).json(orders)
        !orders && res.status(404).json(null)
    }
)