-
Notifications
You must be signed in to change notification settings - Fork 75
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
[www] Add paging capability to proposal list routes #136
Conversation
6b94508
to
120c895
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to get this tested inside refclient as well.
0e3ab7c
to
302f345
Compare
@marcopeereboom updated refclient and API docs, it's ready for re-review. |
politeiawww/backend.go
Outdated
|
||
// Iterate in reverse order because they're sorted by oldest timestamp first. | ||
for i := len(b.inventory) - 1; i >= 0; i-- { | ||
p := b.inventory[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- rename p to proposal
politeiawww/backend.go
Outdated
for i := len(b.inventory) - 1; i >= 0; i-- { | ||
p := b.inventory[i] | ||
if _, ok := statusMap[p.Status]; ok { | ||
if pageStarted { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch { in place of if-else chains (idiomatic)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a result the break needs to be changed to break "TAG Before the for like this 'tag:'".
politeiawww/backend.go
Outdated
// If beforeIdx is set, the caller is asking for vetted proposals whose | ||
// last result is before the provided proposal. | ||
if beforeIdx >= 0 { | ||
for i := beforeIdx + 1; i < len(b.inventory); i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change for range b.inventory [beforeIdx + 1:]
Summary of changes:
/vetted
and/unvetted
routesv1.ProposalListPageSize
Fixes #43.