ADD: get transactions by Belonging Id handler

This commit is contained in:
MohammadHMazarei
2025-04-20 23:58:10 +03:30
parent c89da28bd9
commit 77191d957e
@@ -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) => { exports.getBelongingInventory = catchAsync(async (req, res, next) => {
const result = await transactionService.getBelongingInventory(req.params.belongingId) const result = await transactionService.getBelongingInventory(req.params.belongingId)