project-nomad/admin/app/controllers/home_controller.ts
2025-07-09 09:08:21 -07:00

25 lines
690 B
TypeScript

import { SystemService } from '#services/system_service'
import { inject } from '@adonisjs/core'
import type { HttpContext } from '@adonisjs/core/http'
@inject()
export default class HomeController {
constructor(
private systemService: SystemService,
) { }
async index({ response }: HttpContext) {
// Redirect / to /home
return response.redirect().toPath('/home');
}
async home({ inertia }: HttpContext) {
const services = await this.systemService.getServices({ installedOnly: true });
console.log(services)
return inertia.render('home', {
system: {
services
}
})
}
}