@@ -11,6 +11,7 @@ import { BehaviorSubject } from 'rxjs';
1111import { map } from 'rxjs/operators' ;
1212
1313import { AuthService } from '../../../auth/service/auth.service' ;
14+ import { UserService } from '../../user/service/user.service' ;
1415import { SEATS_BROADCAST_INTERVAL } from '../const/seatsBroadcastInterval.const' ;
1516import { SEATS_SSE_RETRY_TIME } from '../const/seatsSseRetryTime.const' ;
1617import { SeatStatus } from '../const/seatStatus.enum' ;
@@ -37,6 +38,7 @@ export class BookingSeatsService {
3738 private inBookingService : InBookingService ,
3839 private authService : AuthService ,
3940 private eventEmitter : EventEmitter2 ,
41+ private readonly userService : UserService ,
4042 ) {
4143 this . redis = this . redisService . getOrThrow ( ) ;
4244 }
@@ -57,7 +59,7 @@ export class BookingSeatsService {
5759 }
5860
5961 async bookSeat ( sid : string , target : [ number , number ] ) {
60- const eventId = await this . authService . getUserEventTarget ( sid ) ;
62+ const eventId = await this . userService . getUserEventTarget ( sid ) ;
6163 const bookedSeat = await this . inBookingService . getBookedSeats ( sid ) ;
6264 const bookingAmount = await this . inBookingService . getBookingAmount ( sid ) ;
6365 const bookedAmount = bookedSeat . length ;
@@ -74,7 +76,7 @@ export class BookingSeatsService {
7476 }
7577
7678 async unBookSeat ( sid : string , target : [ number , number ] ) {
77- const eventId = await this . authService . getUserEventTarget ( sid ) ;
79+ const eventId = await this . userService . getUserEventTarget ( sid ) ;
7880 const bookedSeat = await this . inBookingService . getBookedSeats ( sid ) ;
7981 const bookedAmount = bookedSeat . length ;
8082
0 commit comments