diff --git a/components/transaction/transactionService.js b/components/transaction/transactionService.js index 5cad88b..864ba5a 100644 --- a/components/transaction/transactionService.js +++ b/components/transaction/transactionService.js @@ -54,6 +54,10 @@ const getUserTransaction = async (userId) => { return Transaction.find({ userId }, null, null) } +const getTransactionByBelongingId = async (belongingId) => { + return Transaction.find({ belongingId }, null, null) +} + const getBelongingInventory = async (belongingId) => { const belonging = await Belonging.findById(belongingId, null, null) @@ -147,4 +151,11 @@ const deleteTransaction = async (transactionId) => { return null } -module.exports = { createTransaction, getUserTransaction, getBelongingInventory, updateTransaction, deleteTransaction } +module.exports = { + createTransaction, + getUserTransaction, + getBelongingInventory, + updateTransaction, + deleteTransaction, + getTransactionByBelongingId, +}