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)
|
return Transaction.find({ userId }, null, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getTransactionByBelongingId = async (belongingId) => {
|
||||||
|
return Transaction.find({ belongingId }, null, null)
|
||||||
|
}
|
||||||
|
|
||||||
const getBelongingInventory = async (belongingId) => {
|
const getBelongingInventory = async (belongingId) => {
|
||||||
const belonging = await Belonging.findById(belongingId, null, null)
|
const belonging = await Belonging.findById(belongingId, null, null)
|
||||||
|
|
||||||
@@ -147,4 +151,11 @@ const deleteTransaction = async (transactionId) => {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { createTransaction, getUserTransaction, getBelongingInventory, updateTransaction, deleteTransaction }
|
module.exports = {
|
||||||
|
createTransaction,
|
||||||
|
getUserTransaction,
|
||||||
|
getBelongingInventory,
|
||||||
|
updateTransaction,
|
||||||
|
deleteTransaction,
|
||||||
|
getTransactionByBelongingId,
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user