mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 10:46:14 +01:00
refactor: move plugin hook methods to plugin.hooks.*
This commit is contained in:
@@ -39,7 +39,7 @@ async function rewrite(req, res, next) {
|
||||
|
||||
const pathname = parsedUrl.pathname;
|
||||
const hook = 'action:homepage.get:' + pathname;
|
||||
if (!plugins.hasListeners(hook)) {
|
||||
if (!plugins.hooks.hasListeners(hook)) {
|
||||
req.url = req.path + (!req.path.endsWith('/') ? '/' : '') + pathname;
|
||||
} else {
|
||||
res.locals.homePageRoute = pathname;
|
||||
@@ -54,7 +54,7 @@ exports.rewrite = rewrite;
|
||||
function pluginHook(req, res, next) {
|
||||
var hook = 'action:homepage.get:' + res.locals.homePageRoute;
|
||||
|
||||
plugins.fireHook(hook, {
|
||||
plugins.hooks.fire(hook, {
|
||||
req: req,
|
||||
res: res,
|
||||
next: next,
|
||||
|
||||
Reference in New Issue
Block a user