-
I have been following the guide to integrate Resend as a module for notifications (Resend Integration Guide), and everything seemed fine at first. However, the problem started when I tried to export information, such as the The issue is that not only does it throw a type error, but fields like Codeexport const sendOrderConfirmationWorkflow = createWorkflow(
"send-order-confirmation",
({ id }: WorkflowInput) => {
//@ts-ignore
const { data: orders } = useQueryGraphStep({
entity: "order",
fields: [
"id",
"email",
"currency_code",
"total",
"items.*",
"display_id",
"shipping_address.*",
"created_at",
"shipping_methods.*",
],
filters: {
id,
},
});
// This fails as well despite this -> https://docs.medusajs.com/learn/fundamentals/workflows/multiple-step-usage
//@ts-ignore
// const { data: stores } = useQueryGraphStep({
// entity: "store",
// fields: ["name"],
// }).config({ name: "fetch-stores" });
const baseUrl = transform({}, () => process.env.STOREFRONT_URL);
const notification = sendNotificationStep([
{
to: orders[0].email,
channel: "email",
template: "order-placed",
data: {
order: orders[0],
baseUrl: baseUrl,
},
},
]);
return new WorkflowResponse(notification);
},
); ErrorType '"display_id"' is not assignable to type '"metadata" | "id" | "status" | "created_at" | "updated_at" | "*" | "email" | "currency_code" | "total" | "items.*" | "shipping_address.*" | "shipping_methods.*" | "version" | ... 1189 more ... | "promotion_link.order.raw_original_shipping_tax_total"'. Data{
"id": "noti_01JETG9PK3CVZ83Q9YP9SNZP42",
"to": "[email protected]",
"channel": "email",
"template": "order-placed",
"data": {
"order": {
"id": "order_01JETG9PD459W33SPSTJ4YXWJZ",
"email": "[email protected]",
"currency_code": "eur",
"total": 20,
"items": [
{...}
]
}
},
"provider_id": "resend"
} Additionally, I tried to include more information like urlBase, but it is not included as part of the data. Steps Taken
Issues Observed
Any guidance on how to resolve this would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @amatosc you're only getting a type error, right? If you add |
Beta Was this translation helpful? Give feedback.
I can confirm that everything is working as expected. The previous errors happened because I initially duplicated the workflow file
order-place.ts
fororder-canceled.ts
, but the workflow inside still had the same name, which caused the error. Thank you so much for your help @shahednasser 😊