docs: added a note about typescript declaration file (#5361)

This commit is contained in:
Shahed Nasser
2023-10-12 11:08:25 +03:00
committed by GitHub
parent 66413d094e
commit a91fca69ac

View File

@@ -65,6 +65,12 @@ export declare module "@medusajs/medusa/dist/models/product" {
Notice that you must pass the attributes you added to the entity into the `interface`. The attributes will be merged with the attributes defined in the core `Product` entity.
:::note
If TypeScript still doesn't pick up the custom attributes after adding `src/index.d.ts`, try moving the file to a nested directory in `src`. Please note that this only ensures TypeScript picks up the new attributes, but it doesn't actually reflect the new attributes in the database. That is handled by migrations.
:::
---
## Step 4: Create Migration