From 2df2b3188fe5814bc822facb6ff0362876d1f8ac Mon Sep 17 00:00:00 2001 From: Pavlo Kulyk Date: Thu, 16 Apr 2026 14:22:57 +0300 Subject: [PATCH] fix: update documentation to reflect changes in API file for dashboard setup --- .../docs/tutorial/03-Customization/06-customPages.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/adminforth/documentation/docs/tutorial/03-Customization/06-customPages.md b/adminforth/documentation/docs/tutorial/03-Customization/06-customPages.md index 63e61cbf7..272f0f5b5 100644 --- a/adminforth/documentation/docs/tutorial/03-Customization/06-customPages.md +++ b/adminforth/documentation/docs/tutorial/03-Customization/06-customPages.md @@ -305,9 +305,9 @@ Now we have to define this endpoint in the backend to make our page work: -Open `index.ts` file and add the following code *BEFORE* `admin.express.serve(` ! +Open `api.ts` file and add the following code *BEFORE* `admin.express.authorize` ! -```ts title="/index.ts" +```ts title="/api.ts" import type { IAdminUserExpressRequest } from 'adminforth'; import express from 'express'; @@ -417,11 +417,6 @@ app.get(`${ADMIN_BASE_URL}/api/dashboard/`, ) ) ); - -// serve after you added all api -admin.express.serve(app) -admin.discoverDatabases(); - ``` Install and import Zod before using this pattern: `pnpm add zod` or `npm install zod`, then `import * as z from 'zod';`. `admin.express.withSchema(...)` will convert the Zod schema to OpenAPI for you.