refactor: async

isekai-main
Barış Soner Uşaklı 3 years ago
parent f0394c4965
commit cfd474487a

@ -30,8 +30,8 @@ Plugins.toggleInstall = async function (socket, data) {
return pluginData;
};
Plugins.getActive = function (socket, data, callback) {
plugins.getActive(callback);
Plugins.getActive = async function () {
return await plugins.getActive();
};
Plugins.orderActivePlugins = async function (socket, data) {
@ -39,6 +39,6 @@ Plugins.orderActivePlugins = async function (socket, data) {
await Promise.all(data.map(plugin => db.sortedSetAdd('plugins:active', plugin.order || 0, plugin.name)));
};
Plugins.upgrade = function (socket, data, callback) {
plugins.upgrade(data.id, data.version, callback);
Plugins.upgrade = async function (socket, data) {
return await plugins.upgrade(data.id, data.version);
};

@ -5,8 +5,8 @@ const events = require('../../events');
const Settings = module.exports;
Settings.get = function (socket, data, callback) {
meta.settings.get(data.hash, callback);
Settings.get = async function (socket, data) {
return await meta.settings.get(data.hash);
};
Settings.set = async function (socket, data) {
@ -19,7 +19,6 @@ Settings.set = async function (socket, data) {
await events.log(eventData);
};
Settings.clearSitemapCache = function (socket, data, callback) {
Settings.clearSitemapCache = function () {
require('../../sitemap').clearCache();
callback();
};

@ -5,8 +5,8 @@ const widgets = require('../../widgets');
const Themes = module.exports;
Themes.getInstalled = function (socket, data, callback) {
meta.themes.get(callback);
Themes.getInstalled = async function () {
return await meta.themes.get();
};
Themes.set = async function (socket, data) {

Loading…
Cancel
Save