docs: general improvements and additions (#12296)
This commit is contained in:
@@ -60,7 +60,7 @@ export const highlights = [
|
||||
]
|
||||
|
||||
```ts title="src/api/middlewares.ts" highlights={highlights}
|
||||
import { defineMiddlewares } from "@medusajs/medusa";
|
||||
import { defineMiddlewares } from "@medusajs/medusa"
|
||||
|
||||
export default defineMiddlewares({
|
||||
routes: [
|
||||
@@ -69,13 +69,13 @@ export default defineMiddlewares({
|
||||
method: "GET",
|
||||
middlewares: [
|
||||
(req, res, next) => {
|
||||
req.allowed?.push("b2b_company");
|
||||
next();
|
||||
req.allowed?.push("b2b_company")
|
||||
next()
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
})
|
||||
```
|
||||
|
||||
In this example, you apply a middleware to the [Get Customer Admin API Route](!api!/admin#customers_getcustomersid).
|
||||
|
||||
Reference in New Issue
Block a user