title: how to return a newly created object when using sequelize transcation?
body: <p>I have a following function, which works, when passed a new user data . it saves the object and the child object into the mysql table successfully. but how do i return the object back , once saved to the database, given i'm using sequelize transaction. </p>
  
  <pre><code>static async add(user) {
      let transaction; 
        try {
            // get transaction
          transaction = await models.sequelize.transaction();
  
          //  *****how to return the newly created user *****************************************
  
          models.User.create(user).then(newUser =&gt; {
            const id = newUser.id;
  
             //save address 
            if(user.address){
  
                address.userId = id;
                models.Address.create(address); 
  
            }
          }).catch(error =&gt; {
            throw error;
          }); 
  
          await transaction.commit();
  
        } catch (error) {
            console.log(error); 
              // Rollback transaction 
            if (transaction) await transaction.rollback();
            throw error;
        }
      }
  </code></pre>