nodebb-plugin-calendar-onekite 10.0.14 → 10.0.15
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 +10 -3
- package/package.json +1 -1
package/library.js
CHANGED
|
@@ -319,6 +319,9 @@ plugin.init = async function (params) {
|
|
|
319
319
|
const { router, middleware } = params;
|
|
320
320
|
const settings = await getSettings();
|
|
321
321
|
|
|
322
|
+
try {
|
|
323
|
+
|
|
324
|
+
|
|
322
325
|
// Page route: /calendar
|
|
323
326
|
router.get('/calendar', middleware.buildHeader, async (req, res) => {
|
|
324
327
|
if (!settings.enabled) {
|
|
@@ -339,13 +342,13 @@ plugin.init = async function (params) {
|
|
|
339
342
|
if (!isAdmin) return res.status(403).send('Forbidden');
|
|
340
343
|
next();
|
|
341
344
|
} catch (e) {
|
|
342
|
-
res.status(500).send(e.message);
|
|
345
|
+
return res.status(500).send(e.message);
|
|
343
346
|
}
|
|
344
347
|
}, adminBuild, async (req, res) => {
|
|
345
|
-
|
|
346
|
-
return helpers.renderAdmin(req, res, 'admin/plugins/calendar-onekite', { title: 'Calendar OneKite' });
|
|
348
|
+
return res.render('admin/plugins/calendar-onekite', { title: 'Calendar OneKite' });
|
|
347
349
|
});
|
|
348
350
|
|
|
351
|
+
|
|
349
352
|
});
|
|
350
353
|
|
|
351
354
|
// API: events
|
|
@@ -593,6 +596,10 @@ plugin.init = async function (params) {
|
|
|
593
596
|
|
|
594
597
|
res.json({ deleted: toDelete.length });
|
|
595
598
|
});
|
|
599
|
+
} catch (e) {
|
|
600
|
+
console.error('[calendar-onekite] init error', e);
|
|
601
|
+
}
|
|
602
|
+
|
|
596
603
|
};
|
|
597
604
|
|
|
598
605
|
plugin.addAdminNavigation = async function (header) {
|