mirror of
https://github.com/strapi/strapi.git
synced 2025-07-24 09:25:25 +00:00
21 lines
538 B
JavaScript
21 lines
538 B
JavaScript
'use strict';
|
|
|
|
const { getService } = require('../utils');
|
|
|
|
module.exports = {
|
|
getInitData(ctx) {
|
|
const { toDto } = getService('data-mapper');
|
|
const { findAllComponents } = getService('components');
|
|
const { getAllFieldSizes } = getService('field-sizes');
|
|
const { findAllContentTypes } = getService('content-types');
|
|
|
|
ctx.body = {
|
|
data: {
|
|
fieldSizes: getAllFieldSizes(),
|
|
components: findAllComponents().map(toDto),
|
|
contentTypes: findAllContentTypes().map(toDto),
|
|
},
|
|
};
|
|
},
|
|
};
|