-
Notifications
You must be signed in to change notification settings - Fork 80
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
Update Followers endpoint to extend WP_REST_Controller #1266
Conversation
} | ||
|
||
$response['first'] = \add_query_arg( 'page', 1, $response['partOf'] ); | ||
$response['last'] = \add_query_arg( 'page', \ceil( $response['totalItems'] / $per_page ), $response['partOf'] ); |
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.
by default (no followers) it shows 0
and loading that page throws an error then. either this should link to min 1
or only show up if $data has more than one page.
Now the pages |
Could you describe the scenario where you'd expect an error? I'm not quite following |
oh sorry! if you have only one page and change the page number in the URL to a way higher page. should we show an error then or simply show an empty items array? |
Oh! Core's Posts controller accounts for that, I opted not to bother in the Outbox controller, but happy to reconsider! |
I am fine with both... just wanted to bring up the question... |
* Move file * Update followers endpoint to extend WP_REST_Controlelr * Inherit from Actors_Controller * update schema * Remove debug * Adopt pagination from Outbox Controller Props @pfefferle * Prevent requests that go beyond what's available Props @pfefferle --------- Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
Follow-up to #1146.
Proposed changes:
WP_REST_Controller
.Other information: