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