Skip to content

Commit

Permalink
fix: 매도/매수 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
SeongHyeon0409 committed Nov 29, 2024
1 parent bb80cce commit 65fff78
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/server/src/account/account.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ export class AccountRepository extends Repository<Account> {
await queryRunner.manager
.createQueryBuilder()
.update(Account)
.set({ [typeGiven]: `${typeGiven} + ${change}` })
.set({
// 직접 연산 처리: ()로 감싸 동적 SQL 계산
[typeGiven]: () => `${typeGiven} + :change`,
})
.where('id = :id', { id: accountId })
.setParameters({ change })
.execute();

this.logger.log(`계정 통화 업데이트 완료: accountId=${accountId}`);
Expand Down Expand Up @@ -129,8 +133,6 @@ export class AccountRepository extends Repository<Account> {
return account.availableKRW;
}



async updateAccountBTC(
id: number,
quantity: number,
Expand Down

0 comments on commit 65fff78

Please sign in to comment.