Skip to content

Commit

Permalink
XC-240: Add unit tests for pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
lpahlavi committed Dec 11, 2024
1 parent 1d4b2d4 commit 0021a30
Show file tree
Hide file tree
Showing 4 changed files with 378 additions and 7 deletions.
7 changes: 5 additions & 2 deletions rs/ethereum/cketh/minter/src/dashboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,12 @@ impl DashboardTablePagination {
let pages = (0..num_items)
.step_by(page_size)
.enumerate()
.map(|(index, offset)| DashboardTablePage { index, offset })
.map(|(index, offset)| DashboardTablePage {
index: index + 1,
offset,
})
.collect();
let current_page_index = current_offset / page_size;
let current_page_index = current_offset / page_size + 1;
Self {
table_id: String::from(table_reference),
page_offset_query_param: String::from(page_offset_query_param),
Expand Down
Loading

0 comments on commit 0021a30

Please sign in to comment.