ADD: get transactions by Belonging Id handler
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user