# Kan ik findFilteredTopics gebruiken om Pms te krijgen?

**URL:** https://meta.discourse.org/t/can-i-get-findfilteredtopics-to-get-pms/338863
**Category:** Development
**Created:** [27 november 2024 om 21:59 UTC](https://meta.discourse.org/t/can-i-get-findfilteredtopics-to-get-pms/338863 "2024-11-27T21:59:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [27 november 2024 om 21:59 UTC](https://meta.discourse.org/t/can-i-get-findfilteredtopics-to-get-pms/338863/1 "2024-11-27T21:59:25Z")

</div>

I’m interested in doing something like [GitHub - nolosb/discourse-featured-lists: A Discourse theme component to feature custom topic lists. · GitHub](https://github.com/nolosb/discourse-featured-lists) that makes Pms display on some other pages (like latest).

The idea is that group PMs can be hard to find, so if I could get, say, unread group pms to display on `/unread` then that would be really cool.

Pretending for a minute that I can figure out how to get them to display, what I need is to get the data so that I can display it.

Can I do something like this:

```plaintext
    const topicList = await this.store.findFiltered('topicList', {
      filter: this.args.list.filter,
      params: {
        category: this.args.list.category,
        tags: this.args.list.tag,
        solved: solvedFilter,
      },
    });

```

but make the params get, say, the group PMs for staff or team or whatever?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [29 november 2024 om 15:13 UTC](https://meta.discourse.org/t/can-i-get-findfilteredtopics-to-get-pms/338863/2 "2024-11-29T15:13:52Z")

</div>

Well, it looks like I can sort-of do it like this:

```plaintext
    const topicList = await this.store.findFiltered('topicList', {
      filter: this.args.list.filter,
      // filter: "search",
      params: {
        // category: this.args.list.category,
        // tags: this.args.list.tag,
        // solved: solvedFilter,
        q: "upgraded in:messages"
      },
    });

```

that will give me my messages that have “upgraded” in them.

But I still can’t figure out how to get, say, unread messages, new messages, all messages, messages sent to a group.

Sigh. But it’s not a topic\_list.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [29 november 2024 om 16:28 UTC](https://meta.discourse.org/t/can-i-get-findfilteredtopics-to-get-pms/338863/3 "2024-11-29T16:28:15Z")

</div>

But wait!!! I found the right filter over in

[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/routes/build-private-messages-group-route.js#L33](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/routes/build-private-messages-group-route.js#L33)

```plaintext
    let topicListFilter = `topics/private-messages-group/${this.currentUser.username}/${groupName}`;
    console.log("consider the topic list", topicListFilter);
    const topicList = await this.store.findFiltered('topicList', {
      filter: topicListFilter,
      params: { },
    });

```
