docs: prepare configuration (#7877)

* update configuration

* resolve todos + remove events guides

* disable v2 docs in v1 navbar

* remove v2 from v1 mobile sidebar

* resolve build errors

* fix build errors

* fix lint errors

* fix lint
This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-07-03 19:27:13 +03:00
1 parent 012a624ee4
commit 6713d76db3
57 files changed
+2626 -2906

No files matched your search

@@ -53,7 +53,7 @@ import { model } from "@medusajs/utils"
const MyCustom = model.define("my_custom", {
id: model.id().primaryKey(),
name: model.text(),
age: model.number()
age: model.number(),
}).indexes([
{
on: ["name", "age"],
@@ -82,13 +82,13 @@ import { model } from "@medusajs/utils"
const MyCustom = model.define("my_custom", {
id: model.id().primaryKey(),
name: model.text(),
age: model.number()
age: model.number(),
}).indexes([
{
on: ["name", "age"],
where: {
age: 30
}
age: 30,
},
},
])
@@ -111,15 +111,15 @@ import { model } from "@medusajs/utils"
const MyCustom = model.define("my_custom", {
id: model.id().primaryKey(),
name: model.text(),
age: model.number().nullable()
age: model.number().nullable(),
}).indexes([
{
on: ["name", "age"],
where: {
age: {
$ne: null
}
}
$ne: null,
},
},
},
])
@@ -146,11 +146,11 @@ import { model } from "@medusajs/utils"
const MyCustom = model.define("my_custom", {
id: model.id().primaryKey(),
name: model.text(),
age: model.number()
age: model.number(),
}).indexes([
{
on: ["name", "age"],
unique: true
unique: true,
},
])
@@ -41,25 +41,6 @@ A subscriber file must export:
The above subscriber listens to the `product.created` event. Whenever the event is emitted, it logs in the terminal `A product is created`.
{/* TODO add when we have the admin dashboard to use with V2 for easy testing. */}
{/\* ### Test Subscriber
To test the subscriber, start the Medusa application:
```bash npm2yarn
npm run dev
```
Then, create a product using the Medusa Admin dashboard. Afterward, you’ll see the following messages logged in the terminal:
```bash
info: Processing product.created which has 1 subscribers
A product is created
```
The first message indicates that the `product.created` event was emitted, and the second one is the message logged from the subscriber. \*/}
---
## When to Use Subscribers
@@ -31,6 +31,7 @@ const Navbar = () => {
mobileSidebarOpen,
}}
isLoading={false}
showSearchOpener
/>
)
}
+8 -1
View File
@@ -108,6 +108,13 @@ const nextConfig = {
}/v2/resources/:path*`,
basePath: false,
},
{
source: "/v2/api/:path*",
destination: `${
process.env.NEXT_PUBLIC_API_URL || "https://localhost:3001"
}/v2/api/:path*`,
basePath: false,
},
// TODO comment out once we have the user guide published
// {
// source: "/user-guide",
@@ -122,7 +129,7 @@ const nextConfig = {
{
source: "/:path*",
destination: `${
process.env.NEXT_PUBLIC_DOCS_V1_URL || "https://localhost:3000"
process.env.NEXT_PUBLIC_API_V1_URL || "https://localhost:3001"
}/:path*`,
basePath: false,
},