use constant for message handler
This commit is contained in:
parent
5085fd02ec
commit
11ccefcc30
|
@ -3,13 +3,14 @@ import { RabbitSubscribe } from '@mobicoop/message-broker-module';
|
||||||
import { CommandBus } from '@nestjs/cqrs';
|
import { CommandBus } from '@nestjs/cqrs';
|
||||||
import { CreateAdCommand } from '@modules/ad/core/application/commands/create-ad/create-ad.command';
|
import { CreateAdCommand } from '@modules/ad/core/application/commands/create-ad/create-ad.command';
|
||||||
import { Ad } from './ad.types';
|
import { Ad } from './ad.types';
|
||||||
|
import { AD_CREATED_MESSAGE_HANDLER } from '@src/app.constants';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AdCreatedMessageHandler {
|
export class AdCreatedMessageHandler {
|
||||||
constructor(private readonly commandBus: CommandBus) {}
|
constructor(private readonly commandBus: CommandBus) {}
|
||||||
|
|
||||||
@RabbitSubscribe({
|
@RabbitSubscribe({
|
||||||
name: 'adCreated',
|
name: AD_CREATED_MESSAGE_HANDLER,
|
||||||
})
|
})
|
||||||
public async adCreated(message: string) {
|
public async adCreated(message: string) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue