Skip to content

Commit 5a285c4

Browse files
committed
rename workflow
1 parent 271b3b1 commit 5a285c4

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

packages/core/core-flows/src/product/workflows/link-product-options-to-product.ts renamed to packages/core/core-flows/src/product/workflows/create-and-link-product-options-to-product.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ export type LinkProductOptionsToProductWorkflowInput = {
3030
remove?: string[]
3131
}
3232

33-
export const linkProductOptionsToProductWorkflowId =
34-
"link-product-options-to-product"
33+
export const createAndLinkProductOptionsToProductWorkflowId =
34+
"create-and-link-product-options-to-product"
3535
/**
3636
* This workflow adds/removes one or more product options to/from a product. It's used by the [TODO](TODO).
3737
* This workflow also creates non-existing product options before adding them to the product.
3838
*
3939
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around product-option and product association.
4040
*
4141
* @example
42-
* const { result } = await linkProductOptionsToProductWorkflow(container)
42+
* const { result } = await createAndLinkProductOptionsToProductWorkflow(container)
4343
* .run({
4444
* input: {
4545
* product_id: "prod_123"
@@ -58,8 +58,8 @@ export const linkProductOptionsToProductWorkflowId =
5858
*
5959
* Add/remove one or more product options to/from a product.
6060
*/
61-
export const linkProductOptionsToProductWorkflow = createWorkflow(
62-
linkProductOptionsToProductWorkflowId,
61+
export const createAndLinkProductOptionsToProductWorkflow = createWorkflow(
62+
createAndLinkProductOptionsToProductWorkflowId,
6363
(input: WorkflowData<LinkProductOptionsToProductWorkflowInput>) => {
6464
const { toCreate, toAdd } = transform({ input }, ({ input }) => {
6565
const toCreate: ProductTypes.CreateProductOptionDTO[] = []

packages/core/core-flows/src/product/workflows/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export * from "./delete-product-types"
1616
export * from "./delete-product-tags"
1717
export * from "./delete-product-variants"
1818
export * from "./delete-products"
19-
export * from "./link-product-options-to-product"
19+
export * from "./create-and-link-product-options-to-product"
2020
export * from "./update-collections"
2121
export * from "./update-product-options"
2222
export * from "./update-product-types"

packages/medusa/src/api/admin/products/[id]/options/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from "@medusajs/framework/http"
77
import { HttpTypes } from "@medusajs/framework/types"
88
import { remapKeysForProduct, remapProductResponse } from "../../helpers"
9-
import { linkProductOptionsToProductWorkflow } from "@medusajs/core-flows"
9+
import { createAndLinkProductOptionsToProductWorkflow } from "@medusajs/core-flows"
1010

1111
export const GET = async (
1212
req: AuthenticatedMedusaRequest<HttpTypes.AdminProductOptionParams>,
@@ -35,7 +35,7 @@ export const POST = async (
3535
) => {
3636
const productId = req.params.id
3737

38-
await linkProductOptionsToProductWorkflow(req.scope).run({
38+
await createAndLinkProductOptionsToProductWorkflow(req.scope).run({
3939
input: {
4040
product_id: productId,
4141
...req.validatedBody,

0 commit comments

Comments
 (0)