@ape the standard way to get nodebb modules is require.main.require
const Posts = require.main.require('./src/posts'); Posts.getPostData(pid, callback)How can I get all posts of topic with getTopic api
-
I use
/api/topic/${tid}/${postIndex}
to get data of topic.
BUT the result of posts are limit in 20.
How can I get all topic of post with api.BTW I know the way that
/api/user/${userslug}/topics?page=x
to get all topics of category ,
but it's not work in/api/topic/${tid}/${postIndex}
someone help me plz
-
-
@baris thx for ur reply
but i used/api/topic/782?page=1
and
/api/topic/782?page=2
then i get the result of "posts" are same (last 20 posts)
this is page 1
this is page 2
there is same pid in the posts array
-
What is your nodebb version & git hash? How many pages does that topic have? Make sure you have the fix from here https://github.com/NodeBB/NodeBB/issues/9473 or upgrade to latest.
-
@baris
thx a lot !!!!
it's work finally!
Suggested Topics
-
Unsolved Different entity for "Topic"
Plugin Development • • Nicolas
Copyright © 2022 NodeBB | Contributors