mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 22:53:25 +00:00
feat: recreate admin dashboard using mantine
This commit is contained in:
@@ -31,22 +31,16 @@ export default class AdminController {
|
||||
protected collectionsController: CollectionsController
|
||||
) {}
|
||||
|
||||
async index({ response }: HttpContext) {
|
||||
async index({ inertia }: HttpContext) {
|
||||
const users = await this.usersController.getAllUsersWithTotalRelations();
|
||||
const linksCount = await this.linksController.getTotalLinksCount();
|
||||
const collectionsCount =
|
||||
await this.collectionsController.getTotalCollectionsCount();
|
||||
|
||||
// TODO: return view
|
||||
return response.json({
|
||||
return inertia.render('admin/dashboard', {
|
||||
users: users.map((user) => new UserWithRelationCountDto(user).toJson()),
|
||||
totalLinks: linksCount,
|
||||
totalCollections: collectionsCount,
|
||||
});
|
||||
// return inertia.render('admin/dashboard', {
|
||||
// users: users.map((user) => new UserWithRelationCountDto(user).toJson()),
|
||||
// totalLinks: linksCount,
|
||||
// totalCollections: collectionsCount,
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user