chore: ability to group events on redis event bus (#7655)
* chore: ability to group events on redis event bus * chore: fix tests * Update packages/modules/event-bus-redis/src/services/event-bus-redis.ts Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com> * chore: change shape of input and body data * chore: fix builds * chore: address comments * chore: fix unit test --------- Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
This commit is contained in:
@@ -51,8 +51,8 @@ import {
|
||||
UpdateTagInput,
|
||||
UpdateTypeInput,
|
||||
} from "../types"
|
||||
import { entityNameToLinkableKeysMap, joinerConfig } from "./../joiner-config"
|
||||
import { eventBuilders } from "../utils"
|
||||
import { entityNameToLinkableKeysMap, joinerConfig } from "./../joiner-config"
|
||||
|
||||
type InjectedDependencies = {
|
||||
baseRepository: DAL.RepositoryService
|
||||
@@ -1134,10 +1134,10 @@ export default class ProductModuleService<
|
||||
sharedContext
|
||||
)
|
||||
|
||||
await this.eventBusModuleService_?.emit<ProductCategoryEventData>(
|
||||
ProductCategoryEvents.CATEGORY_CREATED,
|
||||
{ id: productCategory.id }
|
||||
)
|
||||
await this.eventBusModuleService_?.emit<ProductCategoryEventData>({
|
||||
eventName: ProductCategoryEvents.CATEGORY_CREATED,
|
||||
data: { id: productCategory.id },
|
||||
})
|
||||
|
||||
return productCategory
|
||||
}
|
||||
@@ -1154,10 +1154,10 @@ export default class ProductModuleService<
|
||||
sharedContext
|
||||
)
|
||||
|
||||
await this.eventBusModuleService_?.emit<ProductCategoryEventData>(
|
||||
ProductCategoryEvents.CATEGORY_UPDATED,
|
||||
{ id: productCategory.id }
|
||||
)
|
||||
await this.eventBusModuleService_?.emit<ProductCategoryEventData>({
|
||||
eventName: ProductCategoryEvents.CATEGORY_UPDATED,
|
||||
data: { id: productCategory.id },
|
||||
})
|
||||
|
||||
return await this.baseRepository_.serialize(productCategory, {
|
||||
populate: true,
|
||||
@@ -1171,10 +1171,10 @@ export default class ProductModuleService<
|
||||
): Promise<void> {
|
||||
await this.productCategoryService_.delete(categoryId, sharedContext)
|
||||
|
||||
await this.eventBusModuleService_?.emit<ProductCategoryEventData>(
|
||||
ProductCategoryEvents.CATEGORY_DELETED,
|
||||
{ id: categoryId }
|
||||
)
|
||||
await this.eventBusModuleService_?.emit<ProductCategoryEventData>({
|
||||
eventName: ProductCategoryEvents.CATEGORY_DELETED,
|
||||
data: { id: categoryId },
|
||||
})
|
||||
}
|
||||
|
||||
create(
|
||||
|
||||
Reference in New Issue
Block a user