mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-30 18:46:01 +01:00 
			
		
		
		
	refactor: move plugin hook methods to plugin.hooks.*
This commit is contained in:
		| @@ -47,7 +47,7 @@ module.exports = function (Posts) { | ||||
| 			postData.handle = data.handle; | ||||
| 		} | ||||
|  | ||||
| 		let result = await plugins.fireHook('filter:post.create', { post: postData, data: data }); | ||||
| 		let result = await plugins.hooks.fire('filter:post.create', { post: postData, data: data }); | ||||
| 		postData = result.post; | ||||
| 		await db.setObject('post:' + postData.pid, postData); | ||||
|  | ||||
| @@ -65,9 +65,9 @@ module.exports = function (Posts) { | ||||
| 			Posts.uploads.sync(postData.pid), | ||||
| 		]); | ||||
|  | ||||
| 		result = await plugins.fireHook('filter:post.get', { post: postData, uid: data.uid }); | ||||
| 		result = await plugins.hooks.fire('filter:post.get', { post: postData, uid: data.uid }); | ||||
| 		result.post.isMain = isMain; | ||||
| 		plugins.fireHook('action:post.save', { post: _.clone(result.post) }); | ||||
| 		plugins.hooks.fire('action:post.save', { post: _.clone(result.post) }); | ||||
| 		return result.post; | ||||
| 	}; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user