Skip to content

Commit

Permalink
Restored missing endpoint after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Jadowacu1 committed Aug 6, 2024
1 parent 992abed commit 210f814
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/modules/cart/controller/cartControllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,13 @@ const userCreateOrder = (req, res) => {
}


const adminGetOrdersHistory = async(req: ExtendRequest, res:Response)=>{
const OrderHistory = (req as any).orders
return res.status(httpStatus.OK).json({
message: "Order History",
data: { OrderHistory }
})
}

export {
buyerGetCart,
Expand All @@ -445,6 +452,6 @@ export {
buyerUpdateCartStatus,
userCreateOrder,
buyerGetOrders2,
buyerGetOrderStatus2

buyerGetOrderStatus2,
adminGetOrdersHistory
};
2 changes: 1 addition & 1 deletion src/routes/cartRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ router.post("/create-stripe-product", userAuthorization(["buyer"]), validation(p
router.post("/checkout-stripe-session", userAuthorization(["buyer"]), validation(checkoutSessionSchema), stripeCheckoutSession);
router.post("/user-create-order",userAuthorization(["buyer"]), cartControllers.userCreateOrder)
router.put("/update-cart-status",userAuthorization(["buyer"]), cartControllers.buyerUpdateCartStatus)

router.get("/admin-get-order-history",userAuthorization(["admin"]),isOrderEmpty,cartControllers.adminGetOrdersHistory)
export default router;

0 comments on commit 210f814

Please sign in to comment.