From d044e2323180083e810040d2e4bfa4ad3d73d9f7 Mon Sep 17 00:00:00 2001 From: Arios67 Date: Wed, 30 Mar 2022 18:10:35 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=88=EC=95=A1=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ars/src/apis/payment/payment.service.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ars/src/apis/payment/payment.service.ts b/ars/src/apis/payment/payment.service.ts index dc4c84d..aa5d364 100644 --- a/ars/src/apis/payment/payment.service.ts +++ b/ars/src/apis/payment/payment.service.ts @@ -66,24 +66,24 @@ export class PaymentServie { art: soldoutArt, }); + // 유저 누적 포인트 업데이트 + const updated = await queryRunner.manager.save(User, { + ...bidder, + point: bidder.point - price, + }); + // 히스토리 테이블(낙찰자) 저장 await queryRunner.manager.save(History, { point: price, - balance: bidder.point, - user: bidder, + balance: updated.point, + user: updated, payment: payment, }); - // 유저 누적 포인트 업데이트 - await queryRunner.manager.save(User, { - ...bidder, - point: -price, - }); - // 작가 누적 포인트 업데이트 await queryRunner.manager.save(User, { ...artist, - point: +price, + point: artist.point + price, }); await queryRunner.commitTransaction();