显示主题ID数组的主题列表

In our company we use discourse for everyday business.
Discourse is deeply integrated in our erp software.
For better organization of topics,our erp holds many kind of topics ids and posts ids.
In some parts of our app we want to show user list of specific topics in discource. (filtered by our citiera).
In our app there is form which users fills and our app has array of filtered topics.

Is there a way to send query string or formdata to discource endpoint among with array of wanted topics ids and to get list of topics in discource. (ideally with predefined order or ordered as array was)

Same needs we have for getting specific lists of posts by providing array of topics ids.

我也需要这个功能。目前我是这样做的,但这太耗时了。

    const selectedTopics = this.selectedTopics
     //输入话题ID,输出真实话题对象
     this.selectedTopicsID.forEach(function(tid,index){
       Topic.find(tid,{}).then(results => {
         selectedTopics.pushObject(results)
       })
     });

我打算重新打开插件中的 listcontroller(plugin.rb),添加一个新的端点,并在前端初始化器中重新打开 topic-list,然后做类似以下的事情:

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/models/topic-list.js.es6#L129
但肯定有更简单的方法。真的还没有通过 ID 批量获取话题的端点吗?
非常希望能得到一些帮助 :smiley:
编辑:我是这样解决这个问题的:

使用方式如下:

import TopicList from 'discourse/models/topic-list';
    const selectedTopics = this.selectedTopics
    //输入话题ID
    TopicList.topics_array(this.selectedTopicsID).then(results => selectedTopics.pushObjects(results.topic_list.topics))

目前这仍然有一个缺点,即它返回的不是“真实”的 Topic 对象,但我猜添加一行类似下面的代码就能解决:

我仍然不确定这是否是正确的方法,或者是否会破坏安全性。
还可以做另一件事:首先检查 store 中记录是否已存在,然后只加载不存在的部分,使用 fromMap。类似于:

不管怎样,这里已经变得太啰嗦了 :smiley:
这是我的最终解决方案,今天就到此为止: