refactor: async/await, remove dupe code for homepage routes

This commit is contained in:
Barış Soner Uşaklı
2019-08-14 16:27:58 -04:00
parent 1a2a381ae3
commit c9250a01a2
17 changed files with 411 additions and 590 deletions

View File

@@ -1,14 +1,14 @@
'use strict';
const validator = require('validator');
var plugins = require('../../plugins');
const plugins = require('../../plugins');
var hooksController = module.exports;
const hooksController = module.exports;
hooksController.get = function (req, res) {
var hooks = [];
const hooks = [];
Object.keys(plugins.loadedHooks).forEach(function (key, hookIndex) {
var current = {
const current = {
hookName: key,
methods: [],
index: 'hook-' + hookIndex,