block-core / blockcore-explorer

Cross-Chain Multi-Chain Block Explorer
https://explorer.blockcore.net
MIT License
19 stars 21 forks source link

Fix paging on smart contract list view #37

Closed miladsoft closed 2 years ago

miladsoft commented 2 years ago

You can see the modified example in the following link

https://explorer.seniorblockchain.io/#/crs/explorer/contract-address/CMb4xQCVDXsWSwXPYKpgBf8dHxQVh7CiEC

sondreb commented 2 years ago

Empty off set is sent to the API to retrieve the top (latest) items, not the oldest items, which is the default.

Therefore if the UI want to display the latest items first, it must include "offset=" in the query parameters.

In the released version of the indexer, the smart contract history does not support "offset=", it throws error:

"The value '' is invalid."

I think this is just temporarily while @dangershony is working on this, right? So this PR will change the behavior from display the latest items, to showing the oldest items first.

dangershony commented 2 years ago

ah I already fixed it here, I should have made a PR, I will make PRs form now. Note we also needed to apply sorting on the results https://github.com/block-core/blockcore-explorer/commit/d97841cac9c20c7030dfe4b4cef9c522ea0b815b

dangershony commented 2 years ago

In the released version of the indexer, the smart contract history does not support "offset=", it throws error:

Its fixe on indexer now but we will need to release at the same time, so no urgency for now as more changes will come.

dangershony commented 2 years ago

@miladsoft thanks for the PR you can close it now.

miladsoft commented 2 years ago

👌