From 38b90fa65c79d35f42210e09a51f37fa96dbe229 Mon Sep 17 00:00:00 2001 From: Laurent Le Houerou Date: Mon, 6 Dec 2021 13:38:44 +0400 Subject: [PATCH] sort transaction history --- transaction.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/transaction.go b/transaction.go index bc33194..54b8a73 100644 --- a/transaction.go +++ b/transaction.go @@ -98,6 +98,9 @@ func (s *TransactionService) GetLightPageByLimit(ctx context.Context, pagenumber transaction.Time = time.Unix(transaction.Timestamp, 0) transaction.TimeDescription = humanize.Time(transaction.Time) + sort.Slice(transaction.Nft.TransactionHistory, func(i, j int) bool { + return transaction.Nft.TransactionHistory[i].Timestamp > transaction.Nft.TransactionHistory[j].Timestamp + }) } var res []Transaction