Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to testnet #2121

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions app/interactions/addresses/ckb_transactions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class CkbTransactions < ActiveInteraction::Base

object :request, class: ActionDispatch::Request
string :key, default: nil
string :sort, default: "ckb_transaction_id.desc"
string :sort, default: "time.desc"
integer :page, default: 1
integer :page_size, default: CkbTransaction.default_per_page

Expand All @@ -29,16 +29,10 @@ def execute
private

def account_books_ordering
sort_by, sort_order = sort.split(".", 2)
sort_by =
case sort_by
when "time" then "ckb_transactions.block_timestamp"
else "ckb_transactions.id"
end
sort_by = "ckb_transactions.block_timestamp"
_, sort_order = sort.split(".", 2)

if sort_order.nil? || !sort_order.match?(/^(asc|desc)$/i)
sort_order = "asc"
end
sort_order = "asc" unless sort_order&.match?(/^(asc|desc)$/i)

[sort_by, sort_order]
end
Expand Down
Loading