Skip to content

Commit

Permalink
fix: last page
Browse files Browse the repository at this point in the history
  • Loading branch information
k1rill-fedoseev committed Dec 27, 2023
1 parent b11cd6f commit 92057c5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ service UserOpsService {
}

message Pagination {
optional string page_token = 1;
string page_token = 1;
uint32 page_size = 2;
}

Expand Down
28 changes: 12 additions & 16 deletions user-ops-indexer/user-ops-indexer-server/src/services/user_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ impl UserOps for UserOpsService {

let res = ListAccountsResponse {
items: accounts.into_iter().map(|acc| acc.into()).collect(),
next_page_params: Some(Pagination {
page_token: next_page_token.map(|a| to_checksum(&a, None)),
next_page_params: next_page_token.map(|a| Pagination {
page_token: to_checksum(&a, None),
page_size,
}),
};
Expand Down Expand Up @@ -193,9 +193,8 @@ impl UserOps for UserOpsService {

let res = ListBundlesResponse {
items: bundles.into_iter().map(|b| b.into()).collect(),
next_page_params: Some(Pagination {
page_token: next_page_token
.map(|(b, t, i)| format!("{},{},{}", b, t.encode_hex(), i)),
next_page_params: next_page_token.map(|(b, t, i)| Pagination {
page_token: format!("{},{},{}", b, t.encode_hex(), i),
page_size,
}),
};
Expand Down Expand Up @@ -242,8 +241,8 @@ impl UserOps for UserOpsService {

let res = ListUserOpsResponse {
items: ops.into_iter().map(|acc| acc.into()).collect(),
next_page_params: Some(Pagination {
page_token: next_page_token.map(|(b, o)| format!("{},{}", b, o.encode_hex())),
next_page_params: next_page_token.map(|(b, o)| Pagination {
page_token: format!("{},{}", b, o.encode_hex()),
page_size,
}),
};
Expand Down Expand Up @@ -271,9 +270,8 @@ impl UserOps for UserOpsService {

let res = ListBundlersResponse {
items: bundlers.into_iter().map(|b| b.into()).collect(),
next_page_params: Some(Pagination {
page_token: next_page_token
.map(|(t, f)| format!("{},{}", t, to_checksum(&f, None))),
next_page_params: next_page_token.map(|(t, f)| Pagination {
page_token: format!("{},{}", t, to_checksum(&f, None)),
page_size,
}),
};
Expand Down Expand Up @@ -301,9 +299,8 @@ impl UserOps for UserOpsService {

let res = ListPaymastersResponse {
items: paymasters.into_iter().map(|b| b.into()).collect(),
next_page_params: Some(Pagination {
page_token: next_page_token
.map(|(t, f)| format!("{},{}", t, to_checksum(&f, None))),
next_page_params: next_page_token.map(|(t, f)| Pagination {
page_token: format!("{},{}", t, to_checksum(&f, None)),
page_size,
}),
};
Expand Down Expand Up @@ -331,9 +328,8 @@ impl UserOps for UserOpsService {

let res = ListFactoriesResponse {
items: factories.into_iter().map(|b| b.into()).collect(),
next_page_params: Some(Pagination {
page_token: next_page_token
.map(|(t, f)| format!("{},{}", t, to_checksum(&f, None))),
next_page_params: next_page_token.map(|(t, f)| Pagination {
page_token: format!("{},{}", t, to_checksum(&f, None)),
page_size,
}),
};
Expand Down

0 comments on commit 92057c5

Please sign in to comment.