medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
25.92k stars 2.6k forks source link

Docs(Code Issue): Missing imports and formatting inconsistency #9224

Closed amaster507 closed 1 month ago

amaster507 commented 1 month ago

What Medusa version and documentation are you using?

v2

Preliminary Checks

Issue Summary

URL: https://docs.medusajs.com/v2/customization/extend-models/extend-create-product#2-link-brand-to-product-using-workflow-hook

missing the imports:

import { Modules, ContainerRegistrationKeys } from "@medusajs/utils"

And line 19 const remoteLink = ... is indented inconsistently

How can this issue be resolved?

  1. Add missing import line in example
  2. Remove extra indentation from line 19 (~20 after the import statement is added)

Are you interested in working on this issue?

amaster507 commented 1 month ago

Also,

In the Medusa application's logs, you'll find the message Linked brand to products, indicating that the workflow hook handler ran and linked the brand to the products.

This log did not happen for me. I believe to get this log, you will need to add a console log in the scripts you wrote, or maybe increase logging level, but default logging level does not log this line in v2

shahednasser commented 1 month ago

Nice catch! Will open a PR to fix those, seems like the code snippet is missing a logging statement as well.