docs: changes for new releases + fixes (#12945)
* docs: changes for new releases + fixes * remove container option
This commit is contained in:
@@ -612,7 +612,7 @@ export const subscriptionWorkflow1Highlights = [
|
||||
["16", "createWorkflow", "Create a workflow."],
|
||||
["23", "transform", "Set the customer ID to an empty string if not provided."],
|
||||
["28", "when", "If email is not set, try to retrieve customer by its ID."],
|
||||
["47", "transform", "Set the email either to the one in the input or the specified customer's email."],
|
||||
["48", "transform", "Set the email either to the one in the input or the specified customer's email."],
|
||||
]
|
||||
|
||||
```ts title="src/workflows/create-restock-subscription/index.ts" highlights={subscriptionWorkflow1Highlights}
|
||||
@@ -650,6 +650,7 @@ export const createRestockSubscriptionWorkflow = createWorkflow(
|
||||
return !customer.email
|
||||
}
|
||||
).then(() => {
|
||||
// @ts-ignore
|
||||
const { data } = useQueryGraphStep({
|
||||
entity: "customer",
|
||||
fields: ["email"],
|
||||
|
||||
@@ -519,14 +519,14 @@ export const createRestaurantHighlight = [
|
||||
```ts title="src/workflows/restaurant/steps/create-restaurant.ts" highlights={createRestaurantHighlight} collapsibleLines="1-7" expandMoreLabel="Show Imports"
|
||||
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||
import {
|
||||
CreateRestaurantDTO,
|
||||
CreateRestaurant,
|
||||
} from "../../../modules/restaurant/types/mutations"
|
||||
import { RESTAURANT_MODULE } from "../../../modules/restaurant"
|
||||
import RestaurantModuleService from "../../../modules/restaurant/service"
|
||||
|
||||
export const createRestaurantStep = createStep(
|
||||
"create-restaurant-step",
|
||||
async function (data: CreateRestaurantDTO, { container }) {
|
||||
async function (data: CreateRestaurant, { container }) {
|
||||
const restaurantModuleService: RestaurantModuleService = container.resolve(
|
||||
RESTAURANT_MODULE
|
||||
)
|
||||
@@ -602,7 +602,7 @@ export const createRestaurantRouteHighlights = [
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
|
||||
import { MedusaError } from "@medusajs/framework/utils"
|
||||
import {
|
||||
CreateRestaurantDTO,
|
||||
CreateRestaurant,
|
||||
} from "../../modules/restaurant/types/mutations"
|
||||
import {
|
||||
createRestaurantWorkflow,
|
||||
@@ -610,7 +610,7 @@ import {
|
||||
import { restaurantSchema } from "./validation-schemas"
|
||||
|
||||
export async function POST(req: MedusaRequest, res: MedusaResponse) {
|
||||
const validatedBody = restaurantSchema.parse(req.body) as CreateRestaurantDTO
|
||||
const validatedBody = restaurantSchema.parse(req.body) as CreateRestaurant
|
||||
|
||||
if (!validatedBody) {
|
||||
return MedusaError.Types.INVALID_DATA
|
||||
@@ -2449,9 +2449,6 @@ export const setStepSuccessStep = createStep(
|
||||
workflowId: handleDeliveryWorkflowId,
|
||||
},
|
||||
stepResponse: new StepResponse(updatedDelivery, updatedDelivery.id),
|
||||
options: {
|
||||
container,
|
||||
},
|
||||
})
|
||||
}
|
||||
)
|
||||
@@ -2500,9 +2497,6 @@ export const setStepFailedStep = createStep(
|
||||
workflowId: handleDeliveryWorkflowId,
|
||||
},
|
||||
stepResponse: new StepResponse(updatedDelivery, updatedDelivery.id),
|
||||
options: {
|
||||
container,
|
||||
},
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user