mirror of
https://gitlab.com/mobicoop/v3/service/ad.git
synced 2026-01-11 20:02:41 +00:00
fix ad validation after matcher ad creation
This commit is contained in:
@@ -13,12 +13,17 @@ export class MatcherAdCreatedMessageHandler {
|
||||
name: MATCHER_AD_CREATED_MESSAGE_HANDLER,
|
||||
})
|
||||
public async matcherAdCreated(message: string) {
|
||||
const matcherAdCreatedIntegrationEvent: MatcherAdCreatedIntegrationEvent =
|
||||
JSON.parse(message);
|
||||
await this.commandBus.execute(
|
||||
new ValidateAdCommand({
|
||||
id: matcherAdCreatedIntegrationEvent.id,
|
||||
}),
|
||||
);
|
||||
try {
|
||||
const matcherAdCreatedIntegrationEvent: MatcherAdCreatedIntegrationEvent =
|
||||
JSON.parse(message);
|
||||
await this.commandBus.execute(
|
||||
new ValidateAdCommand({
|
||||
id: matcherAdCreatedIntegrationEvent.id,
|
||||
}),
|
||||
);
|
||||
} catch (error: any) {
|
||||
// do not throw error to acknowledge incoming message
|
||||
// error handling should be done in the command handler, if relevant
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,17 @@ export class MatcherAdCreationFailedMessageHandler {
|
||||
name: MATCHER_AD_CREATION_FAILED_MESSAGE_HANDLER,
|
||||
})
|
||||
public async matcherAdCreationFailed(message: string) {
|
||||
const matcherAdCreationFailedIntegrationEvent: MatcherAdCreationFailedIntegrationEvent =
|
||||
JSON.parse(message);
|
||||
await this.commandBus.execute(
|
||||
new InvalidateAdCommand({
|
||||
id: matcherAdCreationFailedIntegrationEvent.id,
|
||||
}),
|
||||
);
|
||||
try {
|
||||
const matcherAdCreationFailedIntegrationEvent: MatcherAdCreationFailedIntegrationEvent =
|
||||
JSON.parse(message);
|
||||
await this.commandBus.execute(
|
||||
new InvalidateAdCommand({
|
||||
id: matcherAdCreationFailedIntegrationEvent.id,
|
||||
}),
|
||||
);
|
||||
} catch (error: any) {
|
||||
// do not throw error to acknowledge incoming message
|
||||
// error handling should be done in the command handler, if relevant
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user