Skip to content

Commit

Permalink
(feat) initial pagination for ListHomeChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
tphoney committed Jul 5, 2024
1 parent f45d2d8 commit c1f1da0
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion changes.proto
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,36 @@ message GetAppSummariesResponse {
repeated changes.AppSummary apps = 1;
}

message ListHomeChangesRequest {}
message PaginationRequest {
// The number of items to return in a single page
int32 pageSize = 1;

// The page number to return. the first page is 0
int32 page = 2;
}

message PaginationResponse {
// The number of items in the current page
int32 pageSize = 1;

// The total number of items available. Expensive to calculate https://www.cybertec-postgresql.com/en/pagination-problem-total-result-count/
// this is done as a separate query
int32 totalItems = 2;

// The current page number
int32 page = 3;

// The total number of pages available. based on the totalItems and pageSize.
int32 totalPages = 4;
}

message ListHomeChangesRequest {
PaginationRequest pagination = 1;
}

message ListHomeChangesResponse {
repeated ChangeSummary changes = 1;
PaginationResponse pagination = 2;
}

message ListHomeAppsRequest {}
Expand Down

0 comments on commit c1f1da0

Please sign in to comment.