Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using --noAlias still keeps the name of association property as if it was aliased #644

Open
TiLopes opened this issue Apr 1, 2023 · 1 comment

Comments

@TiLopes
Copy link

TiLopes commented Apr 1, 2023

Without --noAlias

init-models.ts -> Ocorrencias.belongsTo(Condomino, { as: "autor_condomino", foreignKey: "autor"});
ocorrencias.ts -> autor_condomino!: Condomino;

Everything works perfectly

With --noAlias

init-models.ts -> Ocorrencias.belongsTo(Condomino, { foreignKey: "autor"});
ocorrencias.ts -> autor_condomino!: Condomino;

const test_ocorrencia = await Ocorrencias.findOne({
   where: {
       id_condominio: req.condominioID,
       id: 3,
   },
   include: {
       model: Condomino,
   },
   nest: true,
});
logger.info(test_ocorrencia?.autor_condomino.nome_ocupante); -> returns undefined or just errors without ?.

Error I get if I try to use Condomino directly

UbTYf

Gists

@TiLopes
Copy link
Author

TiLopes commented Apr 21, 2023

Is there any progress on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant