FIX: do not show PM topics when moving posts to an existing public topic (#6876)
This commit is contained in:
@@ -32,20 +32,22 @@ export default Ember.Component.extend({
|
||||
return;
|
||||
}
|
||||
|
||||
searchForTerm(title, { typeFilter: "topic", searchForId: true }).then(
|
||||
function(results) {
|
||||
if (results && results.posts && results.posts.length > 0) {
|
||||
self.set(
|
||||
"topics",
|
||||
results.posts
|
||||
.mapBy("topic")
|
||||
.filter(t => t.get("id") !== currentTopicId)
|
||||
);
|
||||
} else {
|
||||
self.setProperties({ topics: null, loading: false });
|
||||
}
|
||||
searchForTerm(title, {
|
||||
typeFilter: "topic",
|
||||
searchForId: true,
|
||||
restrictToArchetype: "regular"
|
||||
}).then(function(results) {
|
||||
if (results && results.posts && results.posts.length > 0) {
|
||||
self.set(
|
||||
"topics",
|
||||
results.posts
|
||||
.mapBy("topic")
|
||||
.filter(t => t.get("id") !== currentTopicId)
|
||||
);
|
||||
} else {
|
||||
self.setProperties({ topics: null, loading: false });
|
||||
}
|
||||
);
|
||||
});
|
||||
}, 300),
|
||||
|
||||
actions: {
|
||||
|
||||
@@ -107,6 +107,8 @@ export function searchForTerm(term, opts) {
|
||||
const data = { term: term, include_blurbs: "true" };
|
||||
if (opts.typeFilter) data.type_filter = opts.typeFilter;
|
||||
if (opts.searchForId) data.search_for_id = true;
|
||||
if (opts.restrictToArchetype)
|
||||
data.restrict_to_archetype = opts.restrictToArchetype;
|
||||
|
||||
if (opts.searchContext) {
|
||||
data.search_context = {
|
||||
|
||||
Reference in New Issue
Block a user