2023-04-13 11:52:40 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const { getService } = require('../utils');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
getInitData(ctx) {
|
2023-04-13 19:35:15 +02:00
|
|
|
const { toDto } = getService('data-mapper');
|
|
|
|
const { findAllComponents } = getService('components');
|
|
|
|
const { getAllFieldSizes } = getService('field-sizes');
|
|
|
|
const { findAllContentTypes } = getService('content-types');
|
|
|
|
|
2023-04-13 11:52:40 +02:00
|
|
|
ctx.body = {
|
|
|
|
data: {
|
2023-04-13 19:35:15 +02:00
|
|
|
fieldSizes: getAllFieldSizes(),
|
|
|
|
components: findAllComponents().map(toDto),
|
|
|
|
contentTypes: findAllContentTypes().map(toDto),
|
2023-04-13 11:52:40 +02:00
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
};
|