Merge pull request #3345 from strapi/fix/rename-model

Fix model rename not using the right api name to persist files
This commit is contained in:
Jim LAURIE 2019-05-29 08:23:32 -07:00 committed by GitHub
commit b1e14730a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,7 +175,7 @@ module.exports = {
if (plugin) {
await Service.writeModel(name, modelJSON, { plugin });
} else {
await Service.writeModel(name, modelJSON, { api: modelData.apiName });
await Service.writeModel(name, modelJSON, { api: name !== model ? name.toLowerCase() : modelData.apiName});
}
ctx.send({ ok: true });