adminforth 2.27.0-next.31 → 2.27.0-next.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,12 +2,22 @@ import { Express, Request, Response } from "express";
|
|
|
2
2
|
import { IAdminForth } from "adminforth";
|
|
3
3
|
export function initApi(app: Express, admin: IAdminForth) {
|
|
4
4
|
app.get(`${admin.config.baseUrl}/api/hello/`,
|
|
5
|
+
|
|
6
|
+
// you can use data API to work with your database https://adminforth.dev/docs/tutorial/Customization/dataApi/
|
|
5
7
|
async (req: Request, res: Response) => {
|
|
8
|
+
// req.adminUser to get info about the admin users
|
|
6
9
|
const allUsers = await admin.resource("adminuser").list([]);
|
|
7
10
|
res.json({
|
|
8
|
-
message: "
|
|
11
|
+
message: "List of admin users from AdminForth API",
|
|
9
12
|
users: allUsers,
|
|
10
13
|
});
|
|
11
14
|
}
|
|
15
|
+
|
|
16
|
+
// you can use admin.express.authorize to get info about the current user
|
|
17
|
+
admin.express.authorize(
|
|
18
|
+
async (req: Request, res: Response) => {
|
|
19
|
+
res.json({ message: "Current adminuser from AdminForth API", adminUser: req.adminUser });
|
|
20
|
+
}
|
|
21
|
+
)
|
|
12
22
|
);
|
|
13
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adminforth",
|
|
3
|
-
"version": "2.27.0-next.
|
|
3
|
+
"version": "2.27.0-next.33",
|
|
4
4
|
"description": "OpenSource Vue3 powered forth-generation admin panel",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"author": "devforth.io",
|
|
67
|
-
"license": "
|
|
67
|
+
"license": "MIT",
|
|
68
68
|
"type": "module",
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@babel/parser": "^7.27.5",
|