@julian Thanks for getting back to me quickly. Other priorities pulled me away from this, but after looking at your response, it seems like what I'm actually after are "unread" counts, not just notifications. The simple GET solution returned notifications, but not every "unread". Our app is using the session sharing plugin, and we are associating NodeBB accounts with our app accounts. Would I be able to leverage some of the session sharing functionality to get an unread count for users on our app based on their NodeBB account? Thanks
Hello, I want to get all the posts from a Topic
-
Hello,
I'm using I wrote this to get all the posts from a Topic...
const topicData = { posts: posts.posts, category: topic[0].cid, cid: topic[0].cid, tid: topic[0].tid, mainPid: topic[0].mainPid, }; const topicWithPosts = await Topic.getTopicWithPosts( topicData, undefined, posts.uid );
But i'm getting this...
{ posts: [], category: { bgColor: '#fda34b', cid: 1, class: 'col-md-3 col-xs-6', color: '#fff', description: 'Announcements regarding our community', descriptionParsed: '<p>Announcements regarding our community</p>\n', disabled: 0, icon: 'fa-bullhorn', imageClass: 'cover', isSection: 0, link: '', name: 'Announcements', numRecentReplies: 1, order: 1, parentCid: 0, post_count: 30, slug: '1/announcements', topic_count: 4, minTags: 0, maxTags: 5, totalPostCount: 30, totalTopicCount: 4 }, cid: 1, tid: 6, mainPid: 37, tags: [], tagWhitelist: [], minTags: 0, maxTags: 5, thread_tools: [], isFollowing: false, isNotFollowing: true, isIgnoring: false, bookmark: null, postSharing: [], deleter: null, merger: null, related: [], unreplied: false, icons: [] }
I just want to get all the posts from that topic when a person clics to see the replies from a post. Nodebb gives me the replies from that specific post, but I want to get all the posts from that specific topic.
You can see that the posts array are empty. For your information, i'm using filter:post.getPosts hook and
const topic = await Topic.getTopicsByTids([posts.posts[0].tid], posts.uid) method before the Topic.getTopicWithPosts() method to get the topic info I needed to pass in.Thanks.
Suggested Topics
-
-
-
-
Posts with widgets
Unsolved Plugin Development -
Copyright © 2023 NodeBB | Contributors