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

Adicionar suporte para identificar array de relacionamentos em uma transaction #10

Open
victorLessa opened this issue May 10, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@victorLessa
Copy link

victorLessa commented May 10, 2022

No momento caso você execute uma query igual a:

    const trx = await Database.beginTransaction()
    let entity
    try {
      entity = await Entity.audit(
        { ctx, syncRelated: ['users'] },
        async (entity) => {
          await entity.users().sync(users, null, trx)
        }
      ).create(entityData, trx)
     ...

O audit não é capaz de identificar os IDS dos usuários que estão sendo adicionados na transaction, obvio que isso ocorre pois os usuários não foram persistidos no banco de dados ainda, mas como podemos ver no await entity.users().sync(users, null, trx) ja possui os ID dos usuário que serão vinculados, com isso creio ser suficiente para identificar os usuários no meio da transaction

@victorLessa victorLessa added the enhancement New feature or request label May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants