mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 11:25:17 +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 }]);
|
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 });
|
ctx.send({ ok: true });
|
||||||
|
|
||||||
strapi.reload();
|
strapi.reload();
|
||||||
|
|||||||
@ -53,14 +53,6 @@ module.exports = {
|
|||||||
? _.get(strapi.plugins, [source, 'models', name])
|
? _.get(strapi.plugins, [source, 'models', name])
|
||||||
: _.get(strapi.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 = [];
|
const attributes = [];
|
||||||
_.forEach(model.attributes, (params, attr) => {
|
_.forEach(model.attributes, (params, attr) => {
|
||||||
const relation = _.find(model.associations, { alias: 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({
|
attributes.push({
|
||||||
name: attr,
|
name: attr,
|
||||||
params,
|
params,
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const _ = require('lodash');
|
|
||||||
|
|
||||||
const initMap = groups => {
|
const initMap = groups => {
|
||||||
const map = new Map();
|
const map = new Map();
|
||||||
|
|
||||||
@ -17,7 +15,7 @@ const initMap = groups => {
|
|||||||
map.set(key, {
|
map.set(key, {
|
||||||
uid: key,
|
uid: key,
|
||||||
schema: {
|
schema: {
|
||||||
name: _.upperFirst(name || key),
|
name: name || key,
|
||||||
connection,
|
connection,
|
||||||
collectionName,
|
collectionName,
|
||||||
description,
|
description,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user