From 77191d957ec24eafe0b509015ef3272e92babbd8 Mon Sep 17 00:00:00 2001 From: MohammadHMazarei Date: Sun, 20 Apr 2025 23:58:10 +0330 Subject: [PATCH] ADD: get transactions by Belonging Id handler --- components/transaction/transactionController.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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)