Skip to content

Instantly share code, notes, and snippets.

@alphamikle
Created February 11, 2021 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alphamikle/5bf1b184c6c0984a52c8fc5b56537122 to your computer and use it in GitHub Desktop.
Save alphamikle/5bf1b184c6c0984a52c8fc5b56537122 to your computer and use it in GitHub Desktop.
// app.service.ts
@Transaction()
async makeRemittanceWithTypeOrmV2(fromId: number, toId: number, sum: number, withError: boolean, @TransactionManager() transactionEntityManager: EntityManager = null) {
// ...
await this.appServiceV2.savePurseInTransactionV2(fromPurse, transactionEntityManager);
// ...
}
// app.service-v2.ts
// ..
async savePurseInTransactionV2(purse: Purse, transactionManager: EntityManager) {
await transactionManager.save(Purse, purse);
}
// ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment