Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

199
Visualizações
Problem in Typeorm EventSubscriber & Postgres AfterInsert

I have a big problem with EventSubscribers of typeorm & PostgreSQL.

I need to set Notification for a newly created Entity inside the AfterInsert event on TypeormEventSubscriber but, when I try to set the relations there is nothing inserted into the database to do that.

# Output of event.entity

Entity: {
  id: 34,
}

# It seems everything is ok and the record inserted but it's not.

Typeorm runs every query including the event hooks query inside a transaction as it seems, until every query is not done correctly, nothing is inserted into the database, which means I can not create relations in events even in AfterInserted because nothing is written into tables.

there is no other solution for this use case?
I can write the code after entity saved within my service but, not what I'm looking for.

thanks...

TYPEORM:POSTGRESQL Set relations on event hooks

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda