Fix model rename not using the right api name to persist files

This commit is contained in:
Alexandre Bodin 2019-05-29 16:20:16 +02:00
parent c91ab63ebc
commit 518e7d60dd

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 });