mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 11:39:26 +01:00
21 lines
564 B
TypeScript
21 lines
564 B
TypeScript
import { DocsService } from '#services/docs_service'
|
|
import { inject } from '@adonisjs/core'
|
|
import type { HttpContext } from '@adonisjs/core/http'
|
|
|
|
@inject()
|
|
export default class DocsController {
|
|
constructor(
|
|
private docsService: DocsService
|
|
) { }
|
|
|
|
async list({ }: HttpContext) {
|
|
return await this.docsService.getDocs();
|
|
}
|
|
|
|
async show({ params, inertia }: HttpContext) {
|
|
const content = await this.docsService.parseFile(params.slug);
|
|
return inertia.render('docs/show', {
|
|
content,
|
|
});
|
|
}
|
|
} |