Skip to content

Commit

Permalink
adding function that was accidentally removed
Browse files Browse the repository at this point in the history
  • Loading branch information
zanzoonh committed Oct 20, 2024
1 parent 0cd5490 commit b0008aa
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/topics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,17 @@ Topics.isLocked = async function (tid) {
const locked = await Topics.getTopicField(tid, 'locked');
return locked === 1;
};

Topics.search = async function (tid, term) {
if (!tid || !term) {
throw new Error('[[error:invalid-data]]');
}
const result = await plugins.hooks.fire('filter:topic.search', {
tid: tid,
term: term,
ids: [],
});
return Array.isArray(result) ? result : result.ids;
};

require('../promisify')(Topics);

0 comments on commit b0008aa

Please sign in to comment.