Skip to content

Commit

Permalink
fix: Improve transfer method in ProductService
Browse files Browse the repository at this point in the history
  • Loading branch information
suk-6 committed Sep 26, 2024
1 parent 29f477e commit 6651114
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/modules/product/product.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -795,17 +795,15 @@ export class ProductService {
await this.blockchain.getRemainingTokens(product.tokenAddress!).then((remaining) => {
if (remaining < amount) throw new BadRequestException('남은 토큰이 부족합니다.');
});

await this.blockchain.transfer(
user.userAccount!.walletAddress!,
amount,
product.tokenAddress!,
);
},
{
timeout: 10000,
},
)
.then(() => this.updateProductPrice(productId));
.then(() =>
this.blockchain
.transfer(user.userAccount!.walletAddress!, amount, product.tokenAddress!)
.then(() => this.updateProductPrice(productId)),
);
}
}

0 comments on commit 6651114

Please sign in to comment.