Fix multiple typos in medusa docs (#5854)

This commit is contained in:
Sajarin M
2023-12-13 16:21:48 +05:30
committed by GitHub
parent 07107f3565
commit 4710c8ba7e
22 changed files with 42 additions and 42 deletions

View File

@@ -99,7 +99,7 @@ In your terminal, run the following command:
<Details className="border-t-0">
<Summary>Example: Connect to a Supabase Database</Summary>
If you want to connect to a Supabase database, you must use the `--db-url` option with its value beign the connection URL to your Supabase database. For example:
If you want to connect to a Supabase database, you must use the `--db-url` option with its value being the connection URL to your Supabase database. For example:
```bash
npx create-medusa-app@latest --db-url postgresql://postgres:<password>@<host>.supabase.co:5432/postgres

View File

@@ -546,13 +546,13 @@ After using `MedusaError`, the returned error in the response provides a clearer
- `MedusaError.Types.DB_ERROR`: Sets the response code to `500`.
- `MedusaError.Types.DUPLICATE_ERROR`: Sets the response code to `422`.
- `MedusaError.Types.INVALID_ARGUMENT`
- `MedusaError.Types.INVALID_DATA`: Sets the resposne code to `400`.
- `MedusaError.Types.UNAUTHORIZED`: Sets the resposne code to `401`.
- `MedusaError.Types.INVALID_DATA`: Sets the response code to `400`.
- `MedusaError.Types.UNAUTHORIZED`: Sets the response code to `401`.
- `MedusaError.Types.NOT_FOUND`: Sets the response code to `404`.
- `MedusaError.Types.NOT_ALLOWED`: Sets the resposne code to `400`.
- `MedusaError.Types.NOT_ALLOWED`: Sets the response code to `400`.
- `MedusaError.Types.UNEXPECTED_STATE`
- `MedusaError.Types.CONFLICT`: Sets the resposne code to `409`.
- `MedusaError.Types.PAYMENT_AUTHORIZATION_ERROR`: Sets the resposne code to `422`.
- `MedusaError.Types.CONFLICT`: Sets the response code to `409`.
- `MedusaError.Types.PAYMENT_AUTHORIZATION_ERROR`: Sets the response code to `422`.
</Details>
@@ -603,7 +603,7 @@ export const GET = wrapHandler(async (
req: MedusaRequest,
res: MedusaResponse
): Promise<void> => {
throw new Error("An error occured")
throw new Error("An error occurred")
})
```

View File

@@ -55,7 +55,7 @@ If you run into any errors while installing the CLI tool, check out the [trouble
medusa new my-medusa-store # or npx @medusajs/medusa-cli new
```
You'll then be asked to specify your PostgreSQL database credentials. You can choose "Continue" to use the default credentials shown in the terminal, choose "Change credentials" to specify your PostgreSQL credentails, or choose "Skip database setup" to create the database later.
You'll then be asked to specify your PostgreSQL database credentials. You can choose "Continue" to use the default credentials shown in the terminal, choose "Change credentials" to specify your PostgreSQL credentials, or choose "Skip database setup" to create the database later.
:::warning

View File

@@ -10,7 +10,7 @@ In this document, you'll learn what repositories are, how to use them within you
Repositories provide generic helper methods for entities. For example, you can use the `find` method to retrieve all entities with pagination, or `findOne` to retrieve a single entity record.
Repostories are [Typeorm repositories](https://typeorm.io/working-with-repository), so you can refer to Typeorm's documentation on all available methods.
Repositories are [Typeorm repositories](https://typeorm.io/working-with-repository), so you can refer to Typeorm's documentation on all available methods.
By default, you don't need to create a repository for your custom entities. You can retrieve the default repository of an entity using the Entity Manager. You should only create a repository if you want to implement custom methods in it.

View File

@@ -59,7 +59,7 @@ The exported configuration object of type `SubscriberConfig` must include the fo
### Subscriber Handler Function
The default-export of the subscriber file is a handler function that is executed when the events specified in the exported configuration is triggerd.
The default-export of the subscriber file is a handler function that is executed when the events specified in the exported configuration is triggered.
The function accepts a parameter of type `SubscriberArgs`, which has the following properties:
@@ -88,7 +88,7 @@ If you don't pass a subscriber ID to the subscriber configurations, the name of
## Caveats for Local Event Bus
If you use the `event-bus-local` as your event bus sevice, note the following:
If you use the `event-bus-local` as your event bus service, note the following:
- The `subscriberId` passed in the context is overwritten to a random ID when using `event-bus-local`. So, setting the subscriber ID in the context won't have any effect in this case.
- The `eventName` passed to the handler function will be `undefined` when using `event-bus-local` as it doesn't pass the event name properly.

View File

@@ -112,7 +112,7 @@ Object of the following format:
</td>
<td>
Triggered after the `preProcessBatchJob` of a batch job stategy is done executing.
Triggered after the `preProcessBatchJob` of a batch job strategy is done executing.
</td>
<td>
@@ -2012,7 +2012,7 @@ In addition, an error object is passed within the same object as the Payment Pro
//... other payment fields
error: {
name, //string
nessage, //string
message, //string
stack, //(optional) string
}
}

View File

@@ -231,7 +231,7 @@ Every fulfillment provider is registered under two names:
</td>
<td>
By default, it's `SINGLETON` unless defined differently within the fulfillemnt provider service.
By default, it's `SINGLETON` unless defined differently within the fulfillment provider service.
</td>
</tr>

View File

@@ -110,7 +110,7 @@ export default async (
await productService.count()
}`)
} catch (e) {
logger.failure(activityId, `An error occurrect: ${e}`)
logger.failure(activityId, `An error occurred: ${e}`)
}
logger.success(activityId, "Ending loader")

View File

@@ -80,7 +80,7 @@ You can retrieve a list of publishable API keys by sending a request to the [Lis
import { PublishableApiKey } from "@medusajs/medusa"
import { useAdminPublishableApiKeys } from "medusa-react"
const PublishabelApiKeys = () => {
const PublishableApiKeys = () => {
const { publishable_api_keys, isLoading } =
useAdminPublishableApiKeys()
@@ -106,7 +106,7 @@ You can retrieve a list of publishable API keys by sending a request to the [Lis
)
}
export default PublishabelApiKeys
export default PublishableApiKeys
```
</TabItem>

View File

@@ -85,7 +85,7 @@ You can see examples of scheduled job expression patterns on [crontab guru](http
### Scheduled Job Handler Function
The default-export of the scheduled job file is a handler function that is executed when the events specified in the exported configuration is triggerd.
The default-export of the scheduled job file is a handler function that is executed when the events specified in the exported configuration is triggered.
The function accepts a parameter of type `ScheduledJobArgs`, which has the following properties:

View File

@@ -436,7 +436,7 @@ medusa.admin.products.list({
### Selecting Multiple Fields
You can pass more than one field by seperating the field names in the `fields` query parameter with a comma.
You can pass more than one field by separating the field names in the `fields` query parameter with a comma.
For example, to select the `title` and `handle` of products:

View File

@@ -353,7 +353,7 @@ The hook accepts the following parameters:
1. `path`: (required) the first parameter is a string indicating the path of your API Route. For example, if you have custom API Routes that begin with `/admin/vendors`, the value of this parameter would be `vendors`. The `/admin` prefix will be added automatically.
2. `queryKey`: (required) the second parameter is a string used to generate query keys, which are used by Tanstack Query for caching. When the mutation succeeds, the key will be automatically invalidated.
3. `relatedDomains`: (optional) the third parameter is an object that can be used to specify domains related to this custom hook. This will ensure that Tanstack Query invalides the keys for those domains when your custom mutations succeed. For example, if your custom API Route is related to products, you can pass `["products"]` as the value of this parameter. Then, when you use your custom mutation and it succeeds, the product's key `adminProductKeys.all` will be invalidated automatically, and all products will be re-fetched.
3. `relatedDomains`: (optional) the third parameter is an object that can be used to specify domains related to this custom hook. This will ensure that Tanstack Query invalidates the keys for those domains when your custom mutations succeed. For example, if your custom API Route is related to products, you can pass `["products"]` as the value of this parameter. Then, when you use your custom mutation and it succeeds, the product's key `adminProductKeys.all` will be invalidated automatically, and all products will be re-fetched.
4. `options`: (optional) the fourth parameter is an object of [Mutation options](https://tanstack.com/query/v4/docs/react/reference/useMutation).
The request returns an object containing keys like `mutation` which is a function that can be used to send the `POST` request at a later point. You can learn more about the returned object's properties in [TanStack Query's documentation](https://tanstack.com/query/v4/docs/react/reference/useMutation).
@@ -431,7 +431,7 @@ The hook accepts the following parameters:
1. `path`: (required) the first parameter is a string indicating the path of your API Route. For example, if you have custom API Routes that begin with `/admin/vendors`, the value of this parameter would be `vendors`. The `/admin` prefix will be added automatically.
2. `queryKey`: (required) the second parameter is a string used to generate query keys, which are used by Tanstack Query for caching. When the mutation succeeds, the key will be automatically invalidated.
3. `relatedDomains`: (optional) the third parameter is an object that can be used to specify domains related to this custom hook. This will ensure that Tanstack Query invalides the keys for those domains when your custom mutations succeed. For example, if your custom API Route is related to products, you can pass `["products"]` as the value of this parameter. Then, when you use your custom mutation and it succeeds, the product's key `adminProductKeys.all` will be invalidated automatically, and all products will be re-fetched.
3. `relatedDomains`: (optional) the third parameter is an object that can be used to specify domains related to this custom hook. This will ensure that Tanstack Query invalidates the keys for those domains when your custom mutations succeed. For example, if your custom API Route is related to products, you can pass `["products"]` as the value of this parameter. Then, when you use your custom mutation and it succeeds, the product's key `adminProductKeys.all` will be invalidated automatically, and all products will be re-fetched.
4. `options`: (optional) the fourth parameter is an object of [Mutation options](https://tanstack.com/query/v4/docs/react/reference/useMutation).
The request returns an object containing keys like `mutation` which is a function that can be used to send the `DELETE` request at a later point. You can learn more about the returned object's properties in [TanStack Query's documentation](https://tanstack.com/query/v4/docs/react/reference/useMutation).

View File

@@ -94,7 +94,7 @@ You can create a cart with the following code snippet:
<TabItem value="fetch" label="Fetch API">
```ts
fetch(`<BACKEND_URLL>/store/carts`, {
fetch(`<BACKEND_URL>/store/carts`, {
method: "POST",
credentials: "include",
})
@@ -161,7 +161,7 @@ Otherwise, you can assign it a specific region during creation:
<TabItem value="fetch" label="Fetch API">
```jsx
fetch(`<BACKEND_URLL>/store/carts`, {
fetch(`<BACKEND_URL>/store/carts`, {
method: "POST",
credentials: "include",
headers: {
@@ -236,7 +236,7 @@ You can retrieve the cart at any given point using its ID with the following cod
const id = localStorage.getItem("cart_id")
if (id) {
fetch(`<BACKEND_URLL>/store/carts/${id}`, {
fetch(`<BACKEND_URL>/store/carts/${id}`, {
credentials: "include",
})
.then((response) => response.json())
@@ -302,7 +302,7 @@ You can use the following snippet to update any of the carts data:
<TabItem value="fetch" label="Fetch API">
```ts
fetch(`<BACKEND_URLL>/store/carts/${cartId}`, {
fetch(`<BACKEND_URL>/store/carts/${cartId}`, {
method: "POST",
credentials: "include",
headers: {
@@ -368,7 +368,7 @@ You can do that using the same update operation:
<TabItem value="fetch" label="Fetch API">
```ts
fetch(`<BACKEND_URLL>/store/carts/${cartId}`, {
fetch(`<BACKEND_URL>/store/carts/${cartId}`, {
method: "POST",
credentials: "include",
headers: {
@@ -430,7 +430,7 @@ You can do that using the same update operation:
<TabItem value="fetch" label="Fetch API">
```ts
fetch(`<BACKEND_URLL>/store/carts/${cartId}`, {
fetch(`<BACKEND_URL>/store/carts/${cartId}`, {
method: "POST",
credentials: "include",
headers: {
@@ -492,7 +492,7 @@ To create a line item of a product and add it to a cart, you can use the followi
<TabItem value="fetch" label="Fetch API">
```jsx
fetch(`<BACKEND_URLL>/store/carts/${cartId}/line-items`, {
fetch(`<BACKEND_URL>/store/carts/${cartId}/line-items`, {
method: "POST",
credentials: "include",
headers: {
@@ -568,7 +568,7 @@ To update a line item's quantity in the cart, you can use the following code sni
<!-- eslint-disable max-len -->
```ts
fetch(`<BACKEND_URLL>/store/carts/${cartId}/line-items/${lineItemId}`, {
fetch(`<BACKEND_URL>/store/carts/${cartId}/line-items/${lineItemId}`, {
method: "POST",
credentials: "include",
headers: {
@@ -632,7 +632,7 @@ To delete a line item from the cart, you can use the following code snippet:
<!-- eslint-disable max-len -->
```ts
fetch(`<BACKEND_URLL>/store/carts/${cartId}/line-items/${lineItemId}`, {
fetch(`<BACKEND_URL>/store/carts/${cartId}/line-items/${lineItemId}`, {
method: "DELETE",
credentials: "include",
})

View File

@@ -35,7 +35,7 @@ To send an email or another type of notification method, you must have a notific
---
## Methed 1: Using a Subscriber
## Method 1: Using a Subscriber
To subscribe to and handle an event, you must create a [subscriber](../../../development/events/subscribers.mdx).

View File

@@ -732,7 +732,7 @@ You can create a fulfillment by sending a request to the [Create a Fulfillment A
```tsx
import { useAdminCreateFulfillment } from "medusa-react"
const CreateFuilfillment = () => {
const CreateFullfillment = () => {
const createFulfillment = useAdminCreateFulfillment(
orderId
)
@@ -752,7 +752,7 @@ You can create a fulfillment by sending a request to the [Create a Fulfillment A
// ...
}
export default CreateFuilfillment
export default CreateFullfillment
```
</TabItem>

View File

@@ -156,7 +156,7 @@ Each line item returned in any of the carts requests has total fields related
- `tax_total`: The total tax amount applied on the original price taking into account any applied discounts as well.
- `original_tax_total`: The total tax amount applied on the original price without taking into account any applied discounts.
- `subtotal`: The total of the line items price subtracting the amount in `original_tax_total`.
- `origial_total`: The `subtotal` including the `original_tax_total` amount.
- `original_total`: The `subtotal` including the `original_tax_total` amount.
If tax inclusivity is enabled for the line item, `unit_price` will include the tax amount. The tax amount, which will also be the value of `tax_total`, is calculated using [Medusas formula for tax inclusive pricing](#tax-amount-calculation-formula) based on the line items tax rates. The calculation takes into account any discounts applied on the item, which means the discount amount is deducted from the original price.

View File

@@ -53,4 +53,4 @@ Then, you must enable the Manual Fulfillment Provider in at least one region to
After enabling the provider, you must add shipping options for that provider. You can also do that using either the [Medusa Admin](../../user-guide/regions/shipping-options.mdx) or the [Admin REST APIs](../../modules/regions-and-currencies/admin/manage-regions.mdx#add-a-shipping-option-to-a-region).
Finally, try to place an order using either a [storefront](../../starters/nextjs-medusa-starter.mdx) or the [Store APIs](https://docs.medusajs.com/api/store). You should be able to use the shipping options you created for the fullfilment provider.
Finally, try to place an order using either a [storefront](../../starters/nextjs-medusa-starter.mdx) or the [Store APIs](https://docs.medusajs.com/api/store). You should be able to use the shipping options you created for the fulfillment provider.

View File

@@ -112,7 +112,7 @@ Then, you must enable the Webshipper Fulfillment Provider in at least one region
After enabling the provider, you must add shipping options for that provider. You can also do that using either the [Medusa Admin](../../user-guide/regions/shipping-options.mdx) or the [Admin REST APIs](../../modules/regions-and-currencies/admin/manage-regions.mdx#add-a-shipping-option-to-a-region).
Finally, try to place an order using either a [storefront](../../starters/nextjs-medusa-starter.mdx) or the [Store APIs](https://docs.medusajs.com/api/store). You should be able to use the shipping options you created for the fullfilment provider.
Finally, try to place an order using either a [storefront](../../starters/nextjs-medusa-starter.mdx) or the [Store APIs](https://docs.medusajs.com/api/store). You should be able to use the shipping options you created for the fulfillment provider.
---

View File

@@ -110,7 +110,7 @@ After you update the quantity, you can see the `restock-notification.restocked`
:::note
The SendGrid plugin already listens to and handles the `restock-notification.restocked` event. So, if you install it you don't need to manually create a subscriber that handles this event as explained here. This example is only provided for reference on how you can send a notification to the customer using a Notication plugin.
The SendGrid plugin already listens to and handles the `restock-notification.restocked` event. So, if you install it you don't need to manually create a subscriber that handles this event as explained here. This example is only provided for reference on how you can send a notification to the customer using a Notification plugin.
:::

View File

@@ -24,7 +24,7 @@ npm install @medusajs/ui@2.0.0
The [Button](https://docs.medusajs.com/ui/components/button) component has been split into two components: `Button` and `IconButton`.
The `Button` no longer supports the `format` property that was periously used to specify if a button should be styled as a icon button.
The `Button` no longer supports the `format` property that was previously used to specify if a button should be styled as a icon button.
Instead, use the `IconButton` component for this purpose.
@@ -66,7 +66,7 @@ The [Tabs](https://docs.medusajs.com/ui/components/tabs) component allows you to
The [ProgressTabs](https://docs.medusajs.com/ui/components/progress-tabs) component is a new component that can be used to render a set of tab panels with a progress indicator. It is specifically designed to be used for implementing multi-step tasks.
### `CurrencyInpput` Component
### `CurrencyInput` Component
The [CurrencyInput](https://docs.medusajs.com/ui/components/currency-input) component is a new component that can be used to render a currency input field. It is specifically designed to be used for implementing currency inputs, such as money amounts.

View File

@@ -19,7 +19,7 @@ To create a customer group:
3. Click on the New Group button.
4. In the pop-up that opens:
1. Enter a title for the group.
2. Under Metadata, you can optionally attach custom data to the customer group as key-value pairs. This is mostly useful for technical teams and develoeprs.
2. Under Metadata, you can optionally attach custom data to the customer group as key-value pairs. This is mostly useful for technical teams and developers.
5. Once youre done, click on the Publish Group button.
---
@@ -43,7 +43,7 @@ To edit a customer group:
3. Click on Edit in the dropdown.
4. In the pop-up that opens:
1. You can change the title and existing metadata of the group.
2. Under Metadata, you can optionally attach custom data to the customer group as key-value pairs. This is mostly useful for technical teams and develoeprs.
2. Under Metadata, you can optionally attach custom data to the customer group as key-value pairs. This is mostly useful for technical teams and developers.
5. Once youre done, click on the Edit Group button.
---

View File

@@ -50,7 +50,7 @@ const paths: LearningPathType[] = [
descriptionJSX: (
<>
Extend entities, such as <code>User</code> or <code>Product</code>{" "}
entites, to associate them with the <code>Store</code> entity.
entities, to associate them with the <code>Store</code> entity.
</>
),
path: "/development/entities/extend-entity",