diff --git a/lib/configuration/hooks/studio/index.js b/lib/configuration/hooks/studio/index.js index b744eaabfd..3829bb51e6 100644 --- a/lib/configuration/hooks/studio/index.js +++ b/lib/configuration/hooks/studio/index.js @@ -332,67 +332,6 @@ module.exports = function (strapi) { cb(null, obj); }, - /** - * Pull global strapi variable from local server - * in order to provide them to the dashboard - * - * @param {Object} data - * - * @return {Function} cb - */ - - pullServerForDashboard: function (data, cb) { - try { - - // Init ouptput object - const obj = {}; - - // Set the config. - obj.settings = { - url: strapi.config.url, - i18n: strapi.config.i18n - }; - - // Set the models. - obj.models = strapi.models; - - // Format `config.api` for multi templates models. - _.forEach(strapi.api, function (api, key) { - if (api.templates) { - obj.models[key].templates = {}; - } - - // Assign the template attributes with the model attributes. - _.forEach(api.templates, function (template, templateName) { - obj.models[key].templates[templateName] = {}; - obj.models[key].templates[templateName].attributes = {}; - _.forEach(template.attributes, function (value, attributeKey) { - obj.models[key].templates[templateName].attributes[attributeKey] = _.cloneDeep(obj.models[key].attributes[attributeKey]); - }); - obj.models[key].templates[templateName].displayedAttribute = template.displayedAttribute; - }); - }); - - // User count. - const promises = []; - promises.push(strapi.orm.collections.user.count()); - - Promise.all(promises) - .then(function (response) { - // Define if the app is considered as new. - const userCount = response[0]; - obj.settings.isNewApp = !userCount; - - // Finally send the result in the callback. - cb(null, obj); - }, function (err) { - cb(err); - }); - } catch (err) { - cb(err); - } - }, - /** * Rebuild dictionary *