Open TiLopes opened 1 year ago
init-models.ts -> Ocorrencias.belongsTo(Condomino, { as: "autor_condomino", foreignKey: "autor"}); ocorrencias.ts -> autor_condomino!: Condomino;
Everything works perfectly
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 ?.
Gists
Is there any progress on this issue?
Without --noAlias
Everything works perfectly
With --noAlias
Error I get if I try to use Condomino directly
Gists