diff --git a/components/transaction/transactionController.js b/components/transaction/transactionController.js index 301fc9e..d5e6f49 100644 --- a/components/transaction/transactionController.js +++ b/components/transaction/transactionController.js @@ -21,6 +21,16 @@ exports.getUserTransaction = catchAsync(async (req, res, next) => { }) }) +exports.getTransactionByBelongingId = catchAsync(async (req, res, next) => { + const transactions = await transactionService.getTransactionByBelongingId(req.params.belongingId) + + res.status(200).json({ + status: 'success', + results: transactions.length, + data: transactions, + }) +}) + exports.getBelongingInventory = catchAsync(async (req, res, next) => { const result = await transactionService.getBelongingInventory(req.params.belongingId)