mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 07:33:17 +00:00
fix bug(save user via gui)
This commit is contained in:
parent
d1f8fd8f9b
commit
ad2a455466
@ -90,10 +90,9 @@ module.exports = {
|
||||
if (!name) return ctx.badRequest(null, [{ messages: [{ id: 'request.error.name.missing' }] }]);
|
||||
if (!_.includes(Service.getConnections(), connection)) return ctx.badRequest(null, [{ messages: [{ id: 'request.error.connection.unknow' }] }]);
|
||||
if (strapi.models[_.toLower(name)] && name !== model) return ctx.badRequest(null, [{ messages: [{ id: 'request.error.model.exist' }] }]);
|
||||
if (!strapi.models[_.toLower(model)]) return ctx.badRequest(null, [{ messages: [{ id: 'request.error.model.unknow' }] }]);
|
||||
if (!strapi.models[_.toLower(model)] && plugin && !strapi.plugins[_.toLower(plugin)].models[_.toLower(model)]) return ctx.badRequest(null, [{ messages: [{ id: 'request.error.model.unknow' }] }]);
|
||||
if (!_.isNaN(parseFloat(name[0]))) return ctx.badRequest(null, [{ messages: [{ id: 'request.error.model.name' }] }]);
|
||||
if (plugin && !strapi.plugins[_.toLower(plugin)]) return ctx.badRequest(null, [{ message: [{ id: 'request.error.plugin.name' }] }]);
|
||||
if (plugin && !strapi.plugins[_.toLower(plugin)].models[_.toLower(model)]) return ctx.badRequest(null, [{ message: [{ id: 'request.error.model.unknow' }] }]);
|
||||
|
||||
const [formatedAttributes, attributesErrors] = Service.formatAttributes(attributes, name.toLowerCase(), plugin);
|
||||
|
||||
|
||||
@ -23,8 +23,7 @@
|
||||
"users": {
|
||||
"collection": "user",
|
||||
"via": "role",
|
||||
"plugin": "users-permissions",
|
||||
"configurable": false
|
||||
"plugin": "users-permissions"
|
||||
},
|
||||
"permissions": {
|
||||
"collection": "permission",
|
||||
@ -33,4 +32,4 @@
|
||||
"configurable": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36,6 +36,13 @@
|
||||
"via": "users",
|
||||
"plugin": "users-permissions",
|
||||
"configurable": false
|
||||
},
|
||||
"ddddd": {
|
||||
"type": "string"
|
||||
},
|
||||
"mlkml": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"collectionName": "users-permissions_user"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user