docs: change event payload handling in subscribers (#8078)
This commit is contained in:
+1
-1
@@ -51,7 +51,7 @@ export default async function productCreateHandler({
|
||||
to: "shahednasser@gmail.com",
|
||||
channel: "email",
|
||||
template: "product-created",
|
||||
data: "data" in data ? data.data : data,
|
||||
data: data.data,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ export default async function productCreateHandler({
|
||||
to: "test@gmail.com",
|
||||
channel: "email",
|
||||
template: "product-created",
|
||||
data: "data" in data ? data.data : data,
|
||||
data: data.data,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@ export const subscriberHighlights = [
|
||||
Modules.NOTIFICATION
|
||||
)
|
||||
|
||||
const inventoryItemId = "data" in data ? data.data.id : data.id
|
||||
const inventoryItemId = data.data.id
|
||||
|
||||
const inventoryVariantLinkService = remoteLink.getLinkModule(
|
||||
Modules.PRODUCT,
|
||||
@@ -798,7 +798,7 @@ The `order.placed` event is currently not emitted.
|
||||
data,
|
||||
container,
|
||||
}: SubscriberArgs<{ id: string }>) {
|
||||
const orderId = "data" in data ? data.data.id : data.id
|
||||
const orderId = data.data.id
|
||||
|
||||
const orderModuleService: IOrderModuleService = container
|
||||
.resolve(ModuleRegistrationName.ORDER)
|
||||
|
||||
@@ -1126,7 +1126,7 @@ In the subscriber, you can send a notification, such as an email, to the custome
|
||||
"digitalProductModuleService"
|
||||
)
|
||||
|
||||
const orderId = "data" in data ? data.data.id : data.id
|
||||
const orderId = data.data.id
|
||||
|
||||
const order = await orderModuleService.retrieveOrder(orderId, {
|
||||
relations: ["items"],
|
||||
|
||||
@@ -269,7 +269,7 @@ export const workflowHighlights = [
|
||||
createProductWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
productId: "data" in data ? data.data.id : data.id
|
||||
productId: data.data.id
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
Reference in New Issue
Block a user