Skip to content

Commit 545f5e4

Browse files
committed
feat: extend API to include all user and current user in response
1 parent b985796 commit 545f5e4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

adminforth/commands/createApp/templates/api.ts.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ export function initApi(app: Express, admin: IAdminForth) {
1010
async (req: Request, res: Response) => {
1111
const allUsers = await admin.resource("adminuser").list([]);
1212
res.json({
13-
message: "Hello from AdminForth API!",
13+
message: "List of adminuser from AdminForth API",
1414
users: allUsers,
1515
});
1616
}
1717

1818
// you can use admin.express.authorize to get info about the current user
1919
admin.express.authorize(
2020
async (req: Request, res: Response) => {
21-
res.json({ message: "Hello from AdminForth API!", adminUser: req.adminUser });
21+
res.json({ message: "Current adminuser from AdminForth API", adminUser: req.adminUser });
2222
}
2323
)
2424
);

0 commit comments

Comments
 (0)