From 2446c0b9db9252dd6712190ae3e5de034299ad9d Mon Sep 17 00:00:00 2001 From: Viktor Baranov Date: Thu, 22 Jul 2021 20:11:26 +0300 Subject: [PATCH] Order contracts in the search by inserted_at in descending order --- CHANGELOG.md | 1 + apps/explorer/lib/explorer/chain.ex | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e6537aabb..d93632eab5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - [#4353](https://github.com/blockscout/blockscout/pull/4353) - Added live-reload on the token holders page ### Fixes +- [#4419](https://github.com/blockscout/blockscout/pull/4419) - Order contracts in the search by inserted_at in descending order - [#4406](https://github.com/blockscout/blockscout/pull/4406) - Fix internal server error on the validator's txs page - [#4360](https://github.com/blockscout/blockscout/pull/4360) - Fix false-pending transactions in reorg blocks - [#4388](https://github.com/blockscout/blockscout/pull/4388) - Fix internal server error on contract page for insctances without sourcify envs diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index 4408e60456..e237905890 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -1131,7 +1131,8 @@ defmodule Explorer.Chain do query = from(smart_contract in SmartContract, where: fragment("to_tsvector('english', name ) @@ to_tsquery(?)", ^term), - select: %{contract_address_hash: smart_contract.address_hash, name: smart_contract.name} + select: %{contract_address_hash: smart_contract.address_hash, name: smart_contract.name}, + order_by: [desc: smart_contract.inserted_at] ) Repo.all(query)