fix: bug in inserting guarantee serial and originality serial
This commit is contained in:
@@ -73,7 +73,7 @@ module.exports.add_transaction = [
|
||||
]
|
||||
return msgArray.join(' ')
|
||||
}
|
||||
|
||||
// TODO: here arpa service
|
||||
if (agent === 'main') {
|
||||
const ArpaResponse = await saveTransactionToArpa(data, items, db_name)
|
||||
await TransactionDraft.findByIdAndRemove(draftId)
|
||||
@@ -107,7 +107,7 @@ module.exports.add_transaction = [
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('there is an error in (Post Transaction to Arpa)', e, data)
|
||||
console.log('there is an error in (Post Transaction to Arpa)', e, data)
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ module.exports.get_all_transactions_for_agent = [
|
||||
async (req, res) => {
|
||||
try {
|
||||
const { agent_id } = req
|
||||
const transactions = await Transaction.find({ agent_id }).sort({created_at:-1})
|
||||
const transactions = await Transaction.find({ agent_id }).sort({ created_at: -1 })
|
||||
return res.json(transactions)
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
@@ -291,7 +291,8 @@ module.exports.change_transaction_status_by_agent = [
|
||||
module.exports.get_all_agents_inbox_for_admin = [
|
||||
async (req, res) => {
|
||||
try {
|
||||
const transactions = await Transaction.find().sort({created_at:-1})
|
||||
const transactions = await Transaction.find()
|
||||
.sort({ created_at: -1 })
|
||||
.populate('agent_id', 'agent_code full_name')
|
||||
.populate('user_id', 'province_id province_name city_id city_name')
|
||||
return res.json(transactions)
|
||||
|
||||
Reference in New Issue
Block a user