chore: Rename all event keys to uppercase (#7787)

* chore: Rename all event keys to uppercase

* fix: Remove main entity from event builder
This commit is contained in:
Stevche Radevski
2024-06-21 10:41:35 +02:00
committed by GitHub
parent 937a632eb6
commit ee35379e21
22 changed files with 166 additions and 187 deletions

View File

@@ -16,20 +16,17 @@ import { Context, EventBusTypes } from "@medusajs/types"
* sharedContext,
* })
*
* @param isMainEntity
* @param action
* @param object
* @param eventsEnum
* @param service
*/
export function eventBuilderFactory({
isMainEntity,
action,
object,
eventsEnum,
source,
}: {
isMainEntity?: boolean
action: string
object: string
eventsEnum: Record<string, string>
@@ -55,9 +52,7 @@ export function eventBuilderFactory({
action,
context: sharedContext,
data: { id: dataItem.id },
eventName: isMainEntity
? eventsEnum[action]
: eventsEnum[`${object}_${action}`],
eventName: eventsEnum[`${object}_${action}`],
object,
})
})