feat: recreate admin dashboard using mantine

This commit is contained in:
Sonny
2024-11-08 18:05:00 +01:00
committed by Sonny
parent 6eb88871e8
commit 174a21288a
7 changed files with 276 additions and 10 deletions

View File

@@ -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,
// });
}
}