feat(medusa): Modules initializer (#3352)
This commit is contained in:
@@ -153,11 +153,9 @@ export default class StockLocationService {
|
||||
}
|
||||
const result = await locationRepo.save(loc)
|
||||
|
||||
await this.eventBusService_
|
||||
.withTransaction(manager)
|
||||
.emit(StockLocationService.Events.CREATED, {
|
||||
id: result.id,
|
||||
})
|
||||
await this.eventBusService_?.emit?.(StockLocationService.Events.CREATED, {
|
||||
id: result.id,
|
||||
})
|
||||
|
||||
return result
|
||||
}
|
||||
@@ -201,11 +199,9 @@ export default class StockLocationService {
|
||||
|
||||
await locationRepo.save(toSave)
|
||||
|
||||
await this.eventBusService_
|
||||
.withTransaction(manager)
|
||||
.emit(StockLocationService.Events.UPDATED, {
|
||||
id: stockLocationId,
|
||||
})
|
||||
await this.eventBusService_?.emit?.(StockLocationService.Events.UPDATED, {
|
||||
id: stockLocationId,
|
||||
})
|
||||
|
||||
return item
|
||||
}
|
||||
@@ -267,10 +263,8 @@ export default class StockLocationService {
|
||||
|
||||
await locationRepo.softRemove({ id })
|
||||
|
||||
await this.eventBusService_
|
||||
.withTransaction(manager)
|
||||
.emit(StockLocationService.Events.DELETED, {
|
||||
id,
|
||||
})
|
||||
await this.eventBusService_?.emit?.(StockLocationService.Events.DELETED, {
|
||||
id,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user