Skip to content

Node.js based forum software built for the modern web

refactor: use async/await

Barış Soner Uşaklıf4aa249d8c35
diff --git a/src/socket.io/admin/config.js b/src/socket.io/admin/config.js
index f08aa1b186..7864dc2d54 100644
--- a/src/socket.io/admin/config.js
+++ b/src/socket.io/admin/config.js
@@ -45,6 +45,6 @@ Config.setMultiple = async function (socket, data) {
}
};
-Config.remove = function (socket, key, callback) {
- meta.configs.remove(key, callback);
+Config.remove = async function (socket, key) {
+ await meta.configs.remove(key);
};
diff --git a/src/socket.io/admin/errors.js b/src/socket.io/admin/errors.js
index f60e9dfea2..9cd3bddcc7 100644
--- a/src/socket.io/admin/errors.js
+++ b/src/socket.io/admin/errors.js
@@ -4,6 +4,6 @@ const meta = require('../../meta');
const Errors = module.exports;
-Errors.clear = function (socket, data, callback) {
- meta.errors.clear(callback);
+Errors.clear = async function () {
+ await meta.errors.clear();
};