docs: remove usages of ts-ignore in examples (#12839)
This commit is contained in:
@@ -533,7 +533,6 @@ type SyncProductsWorkflowInput = {
|
||||
export const syncProductsWorkflow = createWorkflow(
|
||||
"sync-products",
|
||||
({ filters, limit, offset }: SyncProductsWorkflowInput) => {
|
||||
// @ts-ignore
|
||||
const { data, metadata } = useQueryGraphStep({
|
||||
entity: "product",
|
||||
fields: ["id", "title", "description", "handle", "thumbnail", "categories.*", "tags.*"],
|
||||
@@ -542,7 +541,6 @@ export const syncProductsWorkflow = createWorkflow(
|
||||
skip: offset,
|
||||
},
|
||||
filters: {
|
||||
// @ts-ignore
|
||||
status: "published",
|
||||
...filters,
|
||||
},
|
||||
|
||||
@@ -1405,7 +1405,6 @@ type WorkflowInput = {
|
||||
export const createProductsContentfulWorkflow = createWorkflow(
|
||||
{ name: "create-products-contentful-workflow" },
|
||||
(input: WorkflowInput) => {
|
||||
// @ts-ignore
|
||||
const { data } = useQueryGraphStep({
|
||||
entity: "product",
|
||||
fields: [
|
||||
|
||||
@@ -1172,9 +1172,9 @@ You'll create a workflow that retrieves the latest products added to your Medusa
|
||||
Create the file `src/workflows/send-newsletter.ts` with the following content:
|
||||
|
||||
export const workflowHighlights = [
|
||||
["15", "useQueryGraphStep", "Retrieve the products created in the last 7 days."],
|
||||
["32", "when", "Check whether there are new products."],
|
||||
["34", "sendNotificationsStep", "Create a notification with the new products data."],
|
||||
["14", "useQueryGraphStep", "Retrieve the products created in the last 7 days."],
|
||||
["31", "when", "Check whether there are new products."],
|
||||
["33", "sendNotificationsStep", "Create a notification with the new products data."],
|
||||
]
|
||||
|
||||
```ts title="src/workflows/send-newsletter.ts" highlights={workflowHighlights}
|
||||
@@ -1191,7 +1191,6 @@ import {
|
||||
export const sendNewProductsNewsletter = createWorkflow(
|
||||
"send-new-products-newsletter",
|
||||
(input) => {
|
||||
// @ts-ignore
|
||||
const { data: products } = useQueryGraphStep({
|
||||
entity: "product",
|
||||
fields: [
|
||||
|
||||
@@ -1199,9 +1199,9 @@ You'll now create the workflow that uses the `sendNotificationStep` to send the
|
||||
Create the file `src/workflows/send-order-confirmation.ts` with the following content:
|
||||
|
||||
export const workflowHighlights = [
|
||||
["12", "sendOrderConfirmationWorkflow", "Create the workflow that sends an order confirmation email."],
|
||||
["16", "useQueryGraphStep", "Retrieve the order's details."],
|
||||
["44", "sendNotificationStep", "Send the order confirmation email."]
|
||||
["13", "sendOrderConfirmationWorkflow", "Create the workflow that sends an order confirmation email."],
|
||||
["15", "useQueryGraphStep", "Retrieve the order's details."],
|
||||
["43", "sendNotificationStep", "Send the order confirmation email."]
|
||||
]
|
||||
|
||||
```ts title="src/workflows/send-order-confirmation.ts" highlights={workflowHighlights}
|
||||
@@ -1219,7 +1219,6 @@ type WorkflowInput = {
|
||||
export const sendOrderConfirmationWorkflow = createWorkflow(
|
||||
"send-order-confirmation",
|
||||
({ id }: WorkflowInput) => {
|
||||
// @ts-ignore
|
||||
const { data: orders } = useQueryGraphStep({
|
||||
entity: "order",
|
||||
fields: [
|
||||
|
||||
@@ -722,7 +722,6 @@ export const syncStep = createStep(
|
||||
fields: [
|
||||
"id",
|
||||
"title",
|
||||
// @ts-ignore
|
||||
"sanity_product.*",
|
||||
],
|
||||
filters,
|
||||
|
||||
@@ -507,9 +507,9 @@ Next, you'll create the workflow that tracks the order placement event.
|
||||
To create the workflow, create the file `src/workflows/track-order-placed.ts` with the following content:
|
||||
|
||||
export const workflowHighlights = [
|
||||
["16", "useQueryGraphStep", "Retrieve the order's details."],
|
||||
["35", "transform", "Prepare data for tracking."],
|
||||
["58", "trackEventStep", "Track the order placement event in Segment."]
|
||||
["15", "useQueryGraphStep", "Retrieve the order's details."],
|
||||
["34", "transform", "Prepare data for tracking."],
|
||||
["57", "trackEventStep", "Track the order placement event in Segment."]
|
||||
]
|
||||
|
||||
```ts title="src/workflows/track-order-placed.ts" highlights={workflowHighlights}
|
||||
@@ -527,7 +527,6 @@ type WorkflowInput = {
|
||||
export const trackOrderPlacedWorkflow = createWorkflow(
|
||||
"track-order-placed",
|
||||
({ id }: WorkflowInput) => {
|
||||
// @ts-ignore
|
||||
const { data: orders } = useQueryGraphStep({
|
||||
entity: "order",
|
||||
fields: [
|
||||
|
||||
@@ -557,8 +557,8 @@ Medusa provides both steps in its `@medusajs/medusa/core-flows` package.
|
||||
So, to create the workflow, create the file `src/workflows/order-placed-notification.ts` with the following content:
|
||||
|
||||
export const orderPlacedNotificationWorkflowHighlights = [
|
||||
["14", "useQueryGraphStep", "Retrieve the order details using the Query Graph."],
|
||||
["35", "sendNotificationsStep", "Send a notification to Slack with the order details."]
|
||||
["13", "useQueryGraphStep", "Retrieve the order details using the Query Graph."],
|
||||
["34", "sendNotificationsStep", "Send a notification to Slack with the order details."]
|
||||
]
|
||||
|
||||
```ts title="src/workflows/order-placed-notification.ts" highlights={orderPlacedNotificationWorkflowHighlights}
|
||||
@@ -574,7 +574,6 @@ type WorkflowInput = {
|
||||
export const orderPlacedNotificationWorkflow = createWorkflow(
|
||||
"order-placed-notification",
|
||||
({ id }: WorkflowInput) => {
|
||||
// @ts-ignore
|
||||
const { data: orders } = useQueryGraphStep({
|
||||
entity: "order",
|
||||
fields: [
|
||||
|
||||
Reference in New Issue
Block a user