sort transaction history

This commit is contained in:
Laurent Le Houerou 2021-12-06 13:38:44 +04:00
parent feb4a34d62
commit 38b90fa65c

View File

@ -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