nodebb-plugin-calendar-onekite 10.0.15 → 10.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library.js +13 -2
- package/package.json +1 -1
package/library.js
CHANGED
|
@@ -559,8 +559,19 @@ plugin.init = async function (params) {
|
|
|
559
559
|
});
|
|
560
560
|
|
|
561
561
|
// Admin API: get/save settings
|
|
562
|
-
|
|
563
|
-
|
|
562
|
+
// Admin API route for ajaxify: /api/admin/plugins/calendar-onekite
|
|
563
|
+
router.get('/api/admin/plugins/calendar-onekite', ensureLoggedIn, async (req, res, next) => {
|
|
564
|
+
try {
|
|
565
|
+
const isAdmin = await user.isAdministrator(req.uid);
|
|
566
|
+
if (!isAdmin) return res.status(403).json({ error: 'not-allowed' });
|
|
567
|
+
next();
|
|
568
|
+
} catch (e) {
|
|
569
|
+
return res.status(500).json({ error: e.message });
|
|
570
|
+
}
|
|
571
|
+
}, middleware.buildHeader, async (req, res) => {
|
|
572
|
+
return res.render('admin/plugins/calendar-onekite', { title: 'Calendar OneKite' });
|
|
573
|
+
});
|
|
574
|
+
|
|
564
575
|
res.json(settings);
|
|
565
576
|
});
|
|
566
577
|
|