mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	remove plugin.hook check
This commit is contained in:
		| @@ -326,12 +326,8 @@ Topics.isLocked = function (tid, callback) { | ||||
| }; | ||||
|  | ||||
| Topics.search = function (tid, term, callback) { | ||||
| 	if (plugins.hasListeners('filter:topic.search')) { | ||||
| 		plugins.fireHook('filter:topic.search', { | ||||
| 			tid: tid, | ||||
| 			term: term, | ||||
| 		}, callback); | ||||
| 	} else { | ||||
| 		callback(new Error('[[error:no-plugins-available]]'), []); | ||||
| 	} | ||||
| 	plugins.fireHook('filter:topic.search', { | ||||
| 		tid: tid, | ||||
| 		term: term, | ||||
| 	}, callback); | ||||
| }; | ||||
|   | ||||
| @@ -1505,13 +1505,6 @@ describe('Topic\'s', function () { | ||||
| 			}); | ||||
| 		}); | ||||
|  | ||||
| 		it('should error if no search plugin', function (done) { | ||||
| 			socketTopics.search({ uid: adminUid }, { tid: topic.tid, term: 'test' }, function (err) { | ||||
| 				assert.equal(err.message, '[[error:no-plugins-available]]'); | ||||
| 				done(); | ||||
| 			}); | ||||
| 		}); | ||||
|  | ||||
| 		it('should return results', function (done) { | ||||
| 			var plugins = require('../src/plugins'); | ||||
| 			plugins.registerHook('myTestPlugin', { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user