mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 02:44:55 +00:00
Fix tests
This commit is contained in:
parent
128b26f1ee
commit
e68f230baa
@ -306,18 +306,6 @@ module.exports = {
|
||||
return ctx.badRequest(null, [{ messages: removeModelErrors }]);
|
||||
}
|
||||
|
||||
const pluginStore = strapi.store({
|
||||
environment: '',
|
||||
type: 'plugin',
|
||||
name: 'content-manager',
|
||||
});
|
||||
|
||||
const schema = await pluginStore.get({ key: 'schema' });
|
||||
|
||||
delete schema.layout[model];
|
||||
|
||||
await pluginStore.set({ key: 'schema', value: schema });
|
||||
|
||||
ctx.send({ ok: true });
|
||||
|
||||
strapi.reload();
|
||||
|
||||
@ -53,14 +53,6 @@ module.exports = {
|
||||
? _.get(strapi.plugins, [source, 'models', name])
|
||||
: _.get(strapi.models, name);
|
||||
|
||||
const pluginStore = strapi.store({
|
||||
environment: '',
|
||||
type: 'plugin',
|
||||
name: 'content-manager',
|
||||
});
|
||||
|
||||
const schema = await pluginStore.get({ key: 'schema' });
|
||||
|
||||
const attributes = [];
|
||||
_.forEach(model.attributes, (params, attr) => {
|
||||
const relation = _.find(model.associations, { alias: attr });
|
||||
@ -90,17 +82,6 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
|
||||
const appearance = _.get(schema, [
|
||||
'layout',
|
||||
name,
|
||||
'attributes',
|
||||
attr,
|
||||
'appearance',
|
||||
]);
|
||||
if (appearance) {
|
||||
_.set(params, ['appearance', appearance], true);
|
||||
}
|
||||
|
||||
attributes.push({
|
||||
name: attr,
|
||||
params,
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
|
||||
const initMap = groups => {
|
||||
const map = new Map();
|
||||
|
||||
@ -17,7 +15,7 @@ const initMap = groups => {
|
||||
map.set(key, {
|
||||
uid: key,
|
||||
schema: {
|
||||
name: _.upperFirst(name || key),
|
||||
name: name || key,
|
||||
connection,
|
||||
collectionName,
|
||||
description,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user