From d6d4639626e25f69d3246dd9eaf7766ae95dac21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 11 Sep 2021 13:15:56 -0400 Subject: [PATCH] fix: #531, acp page on subfolder install --- library.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/library.js b/library.js index 5fafee6..d8bb36f 100644 --- a/library.js +++ b/library.js @@ -6,9 +6,11 @@ const user = require.main.require('./src/user'); const library = module.exports; library.init = async function (params) { - const { app, middleware } = params; - app.get('/admin/plugins/persona', middleware.admin.buildHeader, renderAdmin); - app.get('/api/admin/plugins/persona', renderAdmin); + const { router, middleware } = params; + const routeHelpers = require.main.require('./src/routes/helpers'); + routeHelpers.setupAdminPageRoute(router, '/admin/plugins/persona', middleware, [], (req, res) => { + res.render('admin/plugins/persona', {}); + }); }; library.addAdminNavigation = async function (header) { @@ -58,10 +60,6 @@ library.getThemeConfig = async function (config) { return config; }; -function renderAdmin(req, res) { - res.render('admin/plugins/persona', {}); -} - library.addUserToTopic = async function (hookData) { const settings = await meta.settings.get('persona'); if (settings.enableQuickReply === 'on') {