Skip to content

Commit

Permalink
fix: 매도 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
SeongHyeon0409 committed Nov 28, 2024
1 parent 58c7cdf commit d45020e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/server/src/account/account.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ export class AccountRepository extends Repository<Account> {
return userAccount;
}

async getAccount(accountId: number, queryRunner: QueryRunner): Promise<Account> {
this.logger.log(`계정 조회 시작: userId=${accountId}`);
async getAccount(id: number, queryRunner: QueryRunner): Promise<Account> {
this.logger.log(`계정 조회 시작: userId=${id}`);
try {
const account = await queryRunner.manager.findOne(Account, {
where: { id: accountId },
where: { user: { id } },
});

this.logger.log(`계정 조회 완료: userId=${accountId}`);
this.logger.log(`계정 조회 완료: userId=${id}`);
return account;
} catch (error) {
this.logger.error(`계정 조회 실패: ${error.message}`, error.stack);
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/trade/trade-bid.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export class BidService extends TradeAskBidService implements OnModuleInit {
queryRunner: QueryRunner,
): Promise<void> {
const { account, typeGiven, typeReceived } = bidDto;
const userAccount = await this.accountRepository.getAccount(account.id, queryRunner);
const userAccount = await this.accountRepository.getAccount(bidDto.userId, queryRunner);

if (typeReceived === 'BTC') {
const btcQuantity = formatQuantity(account.BTC + buyData.quantity);
Expand Down

0 comments on commit d45020e

Please sign in to comment.