Skip to content

Commit

Permalink
docs: fixes to entities overview page (medusajs#4651)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Jul 31, 2023
1 parent c0cf786 commit d4e7f67
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/content/development/entities/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ In this document, you'll learn what Entities are in Medusa.

Entities in medusa represent tables in the database as classes. An example of this would be the `Order` entity which represents the `order` table in the database. Entities provide a uniform way of defining and interacting with data retrieved from the database.

Aside from the entities in the Medusa core package, you can also create your own entities to use in your Medusa backend. Custom entities are TypeScript or JavaScript files located in the `src/models` directory of your Medusa backend. These entities are then transpiled to the `dist/models` directory to be used during the backend's runtime.
Aside from the entities in the Medusa core package, you can also create custom entities to use in your Medusa backend. Custom entities are TypeScript or JavaScript files located in the `src/models` directory of your Medusa backend. You then transpile these entities to be used during the backend's runtime using the `build` command, which moves them to the `dist/models` directory.

Entities are TypeScript files and they are based on [Typeorm’s Entities](https://typeorm.io/entities) and use Typeorm decorators.

Expand All @@ -38,7 +38,7 @@ Some example use cases for the `metadata` attribute include:

### Add and Update Metadata

You can add or update metadata entities either through the REST APIs or through create and update methods in the entity's respective service.
You can add or update metadata entities either through the REST APIs or through create and update methods in the entity's respective [service](../services/overview.mdx).

In the [admin REST APIs](/api/admin), you'll find that in create or update requests of some entities you can also set the `metadata`.

Expand Down Expand Up @@ -99,6 +99,9 @@ Developers can create custom entities in the Medusa backend, a plugin, or in a m
description: 'Learn how to create migrations in Medusa.'
}
},
]} />

<DocCardList colSize={6} items={[
{
type: 'link',
href: '/development/entities/extend-entity',
Expand All @@ -117,4 +120,4 @@ Developers can create custom entities in the Medusa backend, a plugin, or in a m
description: 'Learn how to extend a core Medusa repository.'
}
},
]} />
]} />

0 comments on commit d4e7f67

Please sign in to comment.