Files
medusa-store/www/apps/book
Vraj Patel 7dbef9bedd fix(docs): update workflow API example to include query parameter (#9640)
### Fix Missing Query Parameter in Documentation Example

#### Summary
This pull request addresses a missing query parameter in the Medusa documentation's example for making a request to the workflow endpoint.

#### Issue
The example in the documentation incorrectly shows:
```
curl http://localhost:9000/workflow
```
This causes an issue when running the workflow in code, specifically in `step-2`, where the `name` parameter is `undefined`. 

#### Expected Behavior
The correct curl command should include the `name` query parameter, like so:
```
curl http://localhost:9000/workflow?name=john
```

#### Code Example
Here is the code that demonstrates the issue:

```ts
const step2 = createStep("step-2", async ({ name }: WorkflowInput) => {
  return new StepResponse(`Hello ${name} from step two!`)
})
```

When running the incorrect curl command, the output for `step-2` returns:
```
"Hello undefined from step two!"
```

#### Fix
The pull request proposes updating the example curl command in the documentation to:
```
curl http://localhost:9000/workflow?name=john
```

This ensures that the `name` parameter is correctly passed and resolves the issue of `undefined` values in `step-2`.

#### Steps to Reproduce
1. Implement the workflow and API code as described in the [documentation](https://docs.medusajs.com/v2/basics/workflows#4-test-workflow).
2. Run the curl command:
   ```
   curl http://localhost:9000/workflow
   ```
3. The console will output `Hello undefined from step two!` due to the missing `name` parameter.

#### Suggested Resolution
Update the curl command in the [documentation](https://docs.medusajs.com/v2/basics/workflows#4-test-workflow) to:
```
curl http://localhost:9000/workflow?name=john
```

### Related Issue
Link to the issue: [Medusa Issue #9628](https://github.com/medusajs/medusa/issues/9628)

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-10-17 14:51:43 +00:00
..
2024-08-19 09:47:57 +03:00
2024-08-19 09:47:57 +03:00
2024-05-03 17:36:38 +03:00
2024-05-03 17:36:38 +03:00

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.