mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 07:03:38 +00:00
Complete funnel
This commit is contained in:
parent
e9db64cd89
commit
5f8b4ae667
@ -64,6 +64,8 @@ module.exports = {
|
||||
try {
|
||||
// Create an entry using `queries` system
|
||||
ctx.body = await strapi.plugins['content-manager'].services['contentmanager'].add(ctx.params, ctx.request.body, source);
|
||||
|
||||
strapi.emit('didCreateFirstContentTypeEntry', ctx.params, source);
|
||||
} catch(error) {
|
||||
strapi.log.error(error);
|
||||
ctx.badRequest(null, ctx.request.admin ? [{ messages: [{ id: error.message, field: error.field }] }] : error.message);
|
||||
|
||||
@ -78,6 +78,10 @@ module.exports = {
|
||||
try {
|
||||
fs.writeFileSync(modelFilePath, JSON.stringify(modelJSON, null, 2), 'utf8');
|
||||
|
||||
if (_.isEmpty(strapi.api)) {
|
||||
strapi.emit('didCreateFirstContentType');
|
||||
}
|
||||
|
||||
ctx.send({ ok: true });
|
||||
|
||||
strapi.reload();
|
||||
|
||||
@ -160,9 +160,11 @@ module.exports = {
|
||||
|
||||
try {
|
||||
await strapi.plugins['users-permissions'].services.userspermissions.updateRole(roleID, ctx.request.body);
|
||||
|
||||
strapi.emit('didOpenAccessToFetchContentTypeEntries', ctx.request.body);
|
||||
|
||||
ctx.send({ ok: true });
|
||||
} catch(error) {
|
||||
} catch (error) {
|
||||
ctx.badRequest(null, [{ messages: [{ id: 'An error occurred' }] }]);
|
||||
}
|
||||
},
|
||||
|
||||
@ -420,7 +420,6 @@ module.exports = {
|
||||
arrayOfPromises.push(this.updateUserRole(user, authenticated._id || authenticated.id));
|
||||
});
|
||||
|
||||
|
||||
return Promise.all(arrayOfPromises);
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user