diff --git a/server/src/controllers/order.controller.js b/server/src/controllers/order.controller.js index 4223aaf..778a217 100644 --- a/server/src/controllers/order.controller.js +++ b/server/src/controllers/order.controller.js @@ -18,6 +18,7 @@ const crypto = require('crypto'); const Cart = require("../models/cart.model"); const { isExpired } = require("../utils/checkExpire"); const { Op } = require("sequelize"); +const Tour = require("../models/tour.model"); const tmnCode = process.env.vnp_TmnCode; const secretKey = process.env.vnp_HashSecret; @@ -339,7 +340,10 @@ class OrderController { const user_id = req.params.user_id; const order = await Order.findAll({ - where: { user_id: user_id, status: StatusOrder.COMPLETE } + where: { user_id: user_id, status: StatusOrder.COMPLETE }, + include: [ + Tour + ] }) if (!order)