fix(utils,core-flows): add events constant for translations and use it in workflows (#14277)
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
import { emitEventStep } from "../../common/steps/emit-event"
|
||||
import { createTranslationsStep } from "../steps"
|
||||
import { validateTranslationsStep } from "../steps"
|
||||
import { TranslationWorkflowEvents } from "@medusajs/framework/utils"
|
||||
|
||||
export type CreateTranslationsWorkflowInput = {
|
||||
translations: CreateTranslationDTO[]
|
||||
@@ -57,7 +58,7 @@ export const createTranslationsWorkflow = createWorkflow(
|
||||
)
|
||||
|
||||
emitEventStep({
|
||||
eventName: "translation.created",
|
||||
eventName: TranslationWorkflowEvents.CREATED,
|
||||
data: translationIdEvents,
|
||||
})
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import { emitEventStep } from "../../common/steps/emit-event"
|
||||
import { deleteTranslationsStep } from "../steps"
|
||||
import { TranslationWorkflowEvents } from "@medusajs/framework/utils"
|
||||
|
||||
export type DeleteTranslationsWorkflowInput = { ids: string[] }
|
||||
|
||||
@@ -41,7 +42,7 @@ export const deleteTranslationsWorkflow = createWorkflow(
|
||||
})
|
||||
|
||||
emitEventStep({
|
||||
eventName: "translation.deleted",
|
||||
eventName: TranslationWorkflowEvents.DELETED,
|
||||
data: translationIdEvents,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
import { emitEventStep } from "../../common/steps/emit-event"
|
||||
import { updateTranslationsStep, UpdateTranslationsStepInput } from "../steps"
|
||||
import { validateTranslationsStep } from "../steps"
|
||||
import { TranslationWorkflowEvents } from "@medusajs/framework/utils"
|
||||
|
||||
export type UpdateTranslationsWorkflowInput = UpdateTranslationsStepInput
|
||||
|
||||
@@ -58,7 +59,7 @@ export const updateTranslationsWorkflow = createWorkflow(
|
||||
)
|
||||
|
||||
emitEventStep({
|
||||
eventName: "translation.updated",
|
||||
eventName: TranslationWorkflowEvents.UPDATED,
|
||||
data: translationIdEvents,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user