Просмотр исходного кода

fix(cli): Fix entity generation without translation

Michael Bromley 3 месяцев назад
Родитель
Сommit
d8e20de762
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      packages/cli/src/commands/add/entity/add-entity.ts

+ 1 - 0
packages/cli/src/commands/add/entity/add-entity.ts

@@ -189,6 +189,7 @@ function createEntity(plugin: VendurePluginRef, options: AddEntityOptions) {
         entityClass?.getProperty('translations')?.remove();
         entityClass?.getProperty('translations')?.remove();
         removeImplementsFromClass('Translatable', entityClass);
         removeImplementsFromClass('Translatable', entityClass);
         translationFile.delete();
         translationFile.delete();
+        entityFile.getImportDeclaration('./entity-translation.template')?.remove();
     } else {
     } else {
         entityFile
         entityFile
             .getImportDeclaration('./entity-translation.template')
             .getImportDeclaration('./entity-translation.template')