-
Notifications
You must be signed in to change notification settings - Fork 391
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
Add new API endpoints for forums and topics #11742
base: master
Are you sure you want to change the base?
Conversation
implements 3 endpoints: forum listing, single forum by id with topics, and topic listing
if (is_api_request()) { | ||
return [ | ||
'forums' => json_collection($forums, new ForumTransformer(), ['subforums.subforums']), | ||
'last_topics' => json_collection($lastTopics, new TopicTransformer()), |
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.
another one here. and maybe move the last topics query after this (and for the other one as well)
|
||
return [ | ||
'forum' => json_item($forum, new ForumTransformer(), ['subforums.subforums']), | ||
'topics' => json_collection($topics, new TopicTransformer()), |
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.
need a ->get()
here (or above, or combined here)
'new' => [ | ||
// type 'timestamp' because the values are stored as integer in the database | ||
['column' => 'topic_last_post_time', 'order' => 'DESC', 'type' => 'timestamp'], | ||
['column' => 'topic_last_post_id', 'order' => 'DESC'], |
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.
this destroys performance due to no usable index
Closes #7440
It would be nice to have these available, and in my case, I want to automate some things on my otdb project by using the api to comb through the tournament forum. I would love to at least have the topic listing endpoint available if not the others.
Adds three endpoints: