docs: remove usages of ts-ignore in examples (#12839)
This commit is contained in:
@@ -518,8 +518,8 @@ Create the file `src/workflows/add-custom-to-cart.ts` with the following content
|
||||

|
||||
|
||||
export const workflowHighlights = [
|
||||
["18", "useQueryGraphStep", "Retrieve the cart's details."],
|
||||
["24", "useQueryGraphStep", "Retrieve the variant's details."],
|
||||
["17", "useQueryGraphStep", "Retrieve the cart's details."],
|
||||
["23", "useQueryGraphStep", "Retrieve the variant's details."],
|
||||
]
|
||||
|
||||
```ts title="src/workflows/add-custom-to-cart.ts" highlights={workflowHighlights}
|
||||
@@ -539,7 +539,6 @@ type AddCustomToCartWorkflowInput = {
|
||||
export const addCustomToCartWorkflow = createWorkflow(
|
||||
"add-custom-to-cart",
|
||||
({ cart_id, item }: AddCustomToCartWorkflowInput) => {
|
||||
// @ts-ignore
|
||||
const { data: carts } = useQueryGraphStep({
|
||||
entity: "cart",
|
||||
filters: { id: cart_id },
|
||||
@@ -651,7 +650,6 @@ import { WorkflowResponse } from "@medusajs/framework/workflows-sdk"
|
||||
And replace the last `TODO` in the workflow with the following:
|
||||
|
||||
```ts title="src/workflows/add-custom-to-cart.ts"
|
||||
// @ts-ignore
|
||||
const { data: updatedCarts } = useQueryGraphStep({
|
||||
entity: "cart",
|
||||
filters: { id: cart_id },
|
||||
|
||||
@@ -635,8 +635,8 @@ You can now create the workflow using the steps provided by Medusa and your cust
|
||||
To create the workflow, create the file `src/workflows/create-request-for-quote.ts` with the following content:
|
||||
|
||||
export const createRequestForQuoteHighlights = [
|
||||
["25", "useQueryGraphStep", "Retrieve the cart's details."],
|
||||
["46", "useQueryGraphStep", "Retrieve the customer's details."]
|
||||
["24", "useQueryGraphStep", "Retrieve the cart's details."],
|
||||
["45", "useQueryGraphStep", "Retrieve the customer's details."]
|
||||
]
|
||||
|
||||
```ts title="src/workflows/create-request-for-quote.ts" highlights={createRequestForQuoteHighlights} collapsibleLines="1-20" expandButtonLabel="Show Imports"
|
||||
@@ -663,7 +663,6 @@ type WorkflowInput = {
|
||||
export const createRequestForQuoteWorkflow = createWorkflow(
|
||||
"create-request-for-quote",
|
||||
(input: WorkflowInput) => {
|
||||
// @ts-ignore
|
||||
const { data: carts } = useQueryGraphStep({
|
||||
entity: "cart",
|
||||
fields: [
|
||||
@@ -2584,9 +2583,9 @@ You can now implement the merchant-rejection workflow. Create the file `src/work
|
||||

|
||||
|
||||
export const merchantRejectionWorkflowHighlights = [
|
||||
["15", "useQueryGraphStep", "Retrieve the quote's details."],
|
||||
["24", "validateQuoteNotAccepted", "Validate that the quote isn't already accepted by the customer."],
|
||||
["29", "updateQuotesStep", "Update the quote's status to `merchant_rejected`."]
|
||||
["14", "useQueryGraphStep", "Retrieve the quote's details."],
|
||||
["23", "validateQuoteNotAccepted", "Validate that the quote isn't already accepted by the customer."],
|
||||
["28", "updateQuotesStep", "Update the quote's status to `merchant_rejected`."]
|
||||
]
|
||||
|
||||
```ts title="src/workflows/merchant-reject-quote.ts" highlights={merchantRejectionWorkflowHighlights}
|
||||
@@ -2603,7 +2602,6 @@ type WorkflowInput = {
|
||||
export const merchantRejectQuoteWorkflow = createWorkflow(
|
||||
"merchant-reject-quote-workflow",
|
||||
(input: WorkflowInput) => {
|
||||
// @ts-ignore
|
||||
const { data: quotes } = useQueryGraphStep({
|
||||
entity: "quote",
|
||||
fields: ["id", "status"],
|
||||
@@ -2905,7 +2903,6 @@ type WorkflowInput = {
|
||||
export const merchantSendQuoteWorkflow = createWorkflow(
|
||||
"merchant-send-quote-workflow",
|
||||
(input: WorkflowInput) => {
|
||||
// @ts-ignore
|
||||
const { data: quotes } = useQueryGraphStep({
|
||||
entity: "quote",
|
||||
fields: ["id", "status"],
|
||||
@@ -3282,9 +3279,9 @@ Create the file `src/workflows/customer-reject-quote.ts` with the following cont
|
||||

|
||||
|
||||
export const customerRejectQuoteHighlights = [
|
||||
["16", "useQueryGraphStep", "Retrieve the quote's details."],
|
||||
["25", "validateQuoteNotAccepted", "Validate that the quote isn't already accepted by the customer."],
|
||||
["30", "updateQuotesStep", "Update the quote's status to `customer_rejected`."]
|
||||
["15", "useQueryGraphStep", "Retrieve the quote's details."],
|
||||
["24", "validateQuoteNotAccepted", "Validate that the quote isn't already accepted by the customer."],
|
||||
["29", "updateQuotesStep", "Update the quote's status to `customer_rejected`."]
|
||||
]
|
||||
|
||||
```ts title="src/workflows/customer-reject-quote.ts" highlights={customerRejectQuoteHighlights}
|
||||
@@ -3302,7 +3299,6 @@ type WorkflowInput = {
|
||||
export const customerRejectQuoteWorkflow = createWorkflow(
|
||||
"customer-reject-quote-workflow",
|
||||
(input: WorkflowInput) => {
|
||||
// @ts-ignore
|
||||
const { data: quotes } = useQueryGraphStep({
|
||||
entity: "quote",
|
||||
fields: ["id", "status"],
|
||||
@@ -3511,11 +3507,11 @@ You can now implement the workflow that accepts a quote for a customer. Create t
|
||||

|
||||
|
||||
export const customerAcceptQuoteHighlights = [
|
||||
["21", "useQueryGraphStep", "Retrieve the quote's details."],
|
||||
["30", "validateQuoteCanAcceptStep", "Validate that the quote can be accepted."],
|
||||
["35", "updateQuotesStep", "Update the quote's status to `accepted`."],
|
||||
["40", "confirmOrderEditRequestWorkflow", "Confirm the changes made on the draft order, such as changes to item quantities and prices."],
|
||||
["47", "updateOrderWorkflow", "Update the draft order to change its status and convert it into an order."]
|
||||
["20", "useQueryGraphStep", "Retrieve the quote's details."],
|
||||
["29", "validateQuoteCanAcceptStep", "Validate that the quote can be accepted."],
|
||||
["34", "updateQuotesStep", "Update the quote's status to `accepted`."],
|
||||
["39", "confirmOrderEditRequestWorkflow", "Confirm the changes made on the draft order, such as changes to item quantities and prices."],
|
||||
["46", "updateOrderWorkflow", "Update the draft order to change its status and convert it into an order."]
|
||||
]
|
||||
|
||||
```ts title="src/workflows/customer-accept-quote.ts" highlights={customerAcceptQuoteHighlights}
|
||||
@@ -3538,7 +3534,6 @@ type WorkflowInput = {
|
||||
export const customerAcceptQuoteWorkflow = createWorkflow(
|
||||
"customer-accept-quote-workflow",
|
||||
(input: WorkflowInput) => {
|
||||
// @ts-ignore
|
||||
const { data: quotes } = useQueryGraphStep({
|
||||
entity: "quote",
|
||||
fields: ["id", "draft_order_id", "status"],
|
||||
|
||||
Reference in New Issue
Block a user