1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

afterUpdate event typeORM - NestJS

Discussão em 'Angular' iniciado por JEKES, Julho 10, 2025.

  1. JEKES

    JEKES Guest

    I would like to insert an entry in another table after each update of my data (log table) I've created an EntitySubscriberInterface to do this. The event is correctly triggered but my entity array don't include the id which is updated.

    async afterUpdate(event: UpdateEvent<any>) {
    console.log(event.entity);
    const book = event.entity;// entity should be a book
    const authorId = book.authorId;
    console.log(newAuthorId);
    // this.myService.insertHistory(authorId , event.entity);


    }

    If anybody have an idea. Thanks

    Continue reading...

Compartilhe esta Página