docs: fix code block titles (#5733)
* docs: fix code block titles * remove console * fix build error
This commit is contained in:
@@ -30,7 +30,7 @@ npm install medusa-plugin-discount-generator
|
||||
|
||||
Finally, add the plugin to the `plugins` array in `medusa-config.js`:
|
||||
|
||||
```js title=medusa-config.js
|
||||
```js title="medusa-config.js"
|
||||
const plugins = [
|
||||
// ...
|
||||
{
|
||||
@@ -65,7 +65,7 @@ The `DiscountGeneratorService` has one method `generateDiscount`. This method re
|
||||
|
||||
Here's an example of using the service in an API Route:
|
||||
|
||||
```ts title=src/api/store/generate-discount-code/route.ts
|
||||
```ts title="src/api/store/generate-discount-code/route.ts"
|
||||
import type {
|
||||
MedusaRequest,
|
||||
MedusaResponse,
|
||||
|
||||
@@ -44,7 +44,7 @@ Where `<YOUR_ACCESS_KEY>` is your ipstack account’s access key. It’s availab
|
||||
|
||||
Finally, add the IP lookup plugin into the plugins array exported as part of the Medusa configuration in `medusa-config.js`:
|
||||
|
||||
```js title=medusa-config.js
|
||||
```js title="medusa-config.js"
|
||||
const plugins = [
|
||||
// other plugins...
|
||||
{
|
||||
@@ -80,7 +80,7 @@ You can learn more about creating an API Route [here](../../development/api-rout
|
||||
|
||||
:::
|
||||
|
||||
```ts title=src/api/store/customer-region/route.ts
|
||||
```ts title="src/api/store/customer-region/route.ts"
|
||||
import type {
|
||||
MedusaRequest,
|
||||
MedusaResponse,
|
||||
@@ -124,7 +124,7 @@ For example, you can attach it to all `/store` routes to ensure the customer’s
|
||||
|
||||
<!-- eslint-disable @typescript-eslint/no-var-requires -->
|
||||
|
||||
```ts title=src/api/middlewares.ts
|
||||
```ts title="src/api/middlewares.ts"
|
||||
import type { MiddlewaresConfig } from "@medusajs/medusa"
|
||||
const { preCartCreation } = require(
|
||||
"medusa-plugin-ip-lookup/api/medusa-middleware"
|
||||
|
||||
@@ -44,7 +44,7 @@ npm install medusa-plugin-restock-notification
|
||||
|
||||
Then, add the plugin into the plugins array exported as part of the Medusa configuration in `medusa-config.js`:
|
||||
|
||||
```js title=medusa-config.js
|
||||
```js title="medusa-config.js"
|
||||
const plugins = [
|
||||
// other plugins...
|
||||
{
|
||||
@@ -116,7 +116,7 @@ The SendGrid plugin already listens to and handles the `restock-notification.res
|
||||
|
||||
Here's an example of a [subscriber](../../development/events/subscribers.mdx) that listens to the `restock-notification.restocked` event and uses the [SendGrid plugin](../notifications/sendgrid.mdx) to send the subscribed customers an email:
|
||||
|
||||
```ts title=src/subscribers/restock-notification.ts
|
||||
```ts title="src/subscribers/restock-notification.ts"
|
||||
import {
|
||||
type SubscriberConfig,
|
||||
type SubscriberArgs,
|
||||
|
||||
@@ -37,7 +37,7 @@ npm install medusa-plugin-wishlist
|
||||
|
||||
Finally, add the plugin to the `plugins` array in `medusa-config.js`:
|
||||
|
||||
```js title=medusa-config.js
|
||||
```js title="medusa-config.js"
|
||||
const plugins = [
|
||||
// ...
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user