-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibrary.js
More file actions
46 lines (37 loc) · 1.12 KB
/
Copy pathlibrary.js
File metadata and controls
46 lines (37 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
'use strict';
const controllers = require('./lib/controllers');
const winston = require.main.require('winston');
const meta = require.main.require('./src/meta');
const routeHelpers = require.main.require('./src/routes/helpers');
const plugin = {};
plugin.init = function (params) {
const { router, middleware } = params;
routeHelpers.setupAdminPageRoute(router, '/admin/plugins/category-queue', [], controllers.renderAdminPage);
meta.settings.get('category-queue', function(err, settings) {
if (err) {
winston.error('[plugin/category-queue] Could not retrieve plugin settings!');
plugin.settings = {"1":""};
return;
}
plugin.settings = settings;
});
};
plugin.addAdminNavigation = function (header) {
header.plugins.push({
route: '/plugins/category-queue',
icon: 'fa-tint',
name: 'category-queue',
});
return header;
};
plugin.postQueue = function (postData) {
console.log("🚀 ~ file: library.js:38 ~ postData:", postData)
try {
if (Object.values(plugin.settings).includes(String(postData.data.cid))) {
postData.shouldQueue = true;
}
} catch (error) {
}
return postData
};
module.exports = plugin;