File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
1414 ReviewUpdateDto
1515} from '../dto/review.dto.js' ; // DTO 클래스 import
1616import reviewService from '../service/review.service.js' ;
17+ import { BadgeRepository } from "../../user/repository/badge.repository.js" ;
1718
1819class ReviewController {
1920
@@ -60,6 +61,9 @@ class ReviewController {
6061 // 현재 로그인한 사용자 ID (BigInt 변환)
6162 const userId = BigInt ( req . user . userId ) ;
6263
64+ // accountId 조회
65+ const accountId = BigInt ( req . user . accountId ) ;
66+
6367 // 요청 본문 데이터를 DTO 클래스로 구조화
6468 const reviewDto = new ReviewCreateDto ( req . body ) ;
6569
@@ -71,6 +75,9 @@ class ReviewController {
7175 // BigInt를 JSON 문자열로 변환 후 다시 파싱하여 일반 객체로 변환
7276 const finalData = JSON . parse ( stringifyWithBigInt ( responseData ) ) ;
7377
78+ // 리뷰 뱃지 발급
79+ await BadgeRepository . GiveReviewBadges ( userId , accountId ) ;
80+
7481 // 클라이언트에 응답 전송 (201 Created)
7582 res . status ( StatusCodes . CREATED ) . json ( {
7683 resultType : "SUCCESS" ,
You can’t perform that action at this time.
0 commit comments