notification queue
This commit is contained in:
@@ -20,8 +20,7 @@ import { OrderRepository } from '../repositories/order.repository';
|
||||
import { FindOrdersDto } from '../dto/find-orders.dto';
|
||||
import { PaginatedResult } from 'src/common/interfaces/pagination.interface';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { OrderCreatedEvent, OrderPaymentSuccessEvent } from '../../notifications/events/notification.events';
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class OrdersService {
|
||||
private readonly logger = new Logger(OrdersService.name);
|
||||
@@ -49,14 +48,14 @@ export class OrdersService {
|
||||
|
||||
await this.cartService.clearCart(userId, restaurantId);
|
||||
|
||||
this.eventEmitter2.emit(
|
||||
OrderCreatedEvent.name,
|
||||
new OrderCreatedEvent(restaurantId, order.user.id, order.id, order.total),
|
||||
);
|
||||
this.eventEmitter2.emit(
|
||||
OrderPaymentSuccessEvent.name,
|
||||
new OrderPaymentSuccessEvent(restaurantId, order.user.id, order.id, order.total),
|
||||
);
|
||||
// this.eventEmitter2.emit(
|
||||
// OrderCreatedEvent.name,
|
||||
// new OrderCreatedEvent(restaurantId, order.user.id, order.id, order.total),
|
||||
// );
|
||||
// this.eventEmitter2.emit(
|
||||
// OrderPaymentSuccessEvent.name,
|
||||
// new OrderPaymentSuccessEvent(restaurantId, order.user.id, order.id, order.total),
|
||||
// );
|
||||
console.log('Order created event emitted 111');
|
||||
return { order, paymentUrl };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user