Skip to content

Commit

Permalink
Small fixes to transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
ourwarmhouse committed Nov 11, 2021
1 parent 1c23164 commit f15cbcf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions routes/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ router.get('/admin/transactions/:page?', restrict, async (req, res, next) => {
}

// Get our paginated data
const transactions = await paginateData(false, req, pageNum, 'transactions', {}, { date: -1 });
const transactions = await paginateData(false, req, pageNum, 'transactions', {}, { created: -1 });

res.render('transactions', {
title: 'Cart - Rransactions',
Expand Down Expand Up @@ -44,7 +44,7 @@ router.get('/admin/transactions/filter/:search', restrict, async (req, res, next
});

// we search on the lunr indexes
const results = await db.transactions.find({ _id: { $in: lunrIdArray } }).toArray();
const results = await db.transactions.find({ _id: { $in: lunrIdArray } }).sort({ created: -1 }).toArray();

if(req.apiAuthenticated){
res.status(200).json(results);
Expand Down
19 changes: 14 additions & 5 deletions views/transactions.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@
<div class="col-md-3">
<div class="top-pad-8 text-truncate"><strong>Gateway Reference</strong></div>
</div>
<div class="col-md-3 text-center">
<div class="col-md-2 text-center">
<div class="top-pad-8 text-truncate"><strong>Date</strong></div>
</div>
<div class="col-md-2 text-center">
<div class="top-pad-8 text-truncate"><strong>Gateway Message</strong></div>
</div>
<div class="col-md-3 text-center">
<div class="col-md-2 text-center">
<div class="top-pad-8 text-truncate"><strong>Amount</strong></div>
</div>
</div>
Expand All @@ -48,11 +51,17 @@
<div class="col-md-3">
<div class="top-pad-8 text-truncate">{{this.gatewayReference}}</div>
</div>
<div class="col-md-3 text-center">
<div class="col-md-2 text-center">
<div class="top-pad-8 text-truncate">{{formatDate this.created "DD/MM/YYYY hh:mmA"}}</div>
</div>
<div class="col-md-2 text-center">
<div class="top-pad-8 text-truncate">{{this.gatewayMessage}}</div>
</div>
<div class="col-md-3 text-center">
<div class="top-pad-8 text-truncate">{{this.amount}}</div>
<div class="col-md-2 text-center">
<div class="top-pad-8 text-truncate">
{{@root.config.currencySymbol}}
{{formatAmount this.amount}}
</div>
</div>
</div>
</a>
Expand Down

0 comments on commit f15cbcf

Please sign in to comment.