Skip to content

Commit

Permalink
Fix vault-service
Browse files Browse the repository at this point in the history
  • Loading branch information
nnachevsapcom committed Oct 1, 2023
1 parent dc03c24 commit e1b88c2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/api/src/vault/vault.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ export class VaultService {
amount: number,
tx: Prisma.TransactionClient,
): Promise<Vault> {
const vault = this.updateVaultAmount(vaultId, amount, tx, 'increment')
const vault = await this.updateVaultAmount(vaultId, amount, tx, 'increment')

await this.campaignService.updateCampaignStatusIfTargetReached(vault.campaignId, tx)

return vault
}

Expand All @@ -129,8 +132,7 @@ export class VaultService {
amount: number,
tx: Prisma.TransactionClient,
): Promise<Vault> {
const vault = this.updateVaultAmount(vaultId, amount, tx, 'decrement')
return vault
return this.updateVaultAmount(vaultId, amount, tx, 'decrement')
}

async updateVaultAmount(
Expand Down

0 comments on commit e1b88c2

Please sign in to comment.