mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 03:29:25 +01:00
19 lines
615 B
TypeScript
19 lines
615 B
TypeScript
import type { HttpContext } from '@adonisjs/core/http'
|
|
import { DownloadService } from '#services/download_service'
|
|
import { downloadJobsByFiletypeSchema } from '#validators/download'
|
|
import { inject } from '@adonisjs/core'
|
|
|
|
@inject()
|
|
export default class DownloadsController {
|
|
constructor(private downloadService: DownloadService) {}
|
|
|
|
async index() {
|
|
return this.downloadService.listDownloadJobs()
|
|
}
|
|
|
|
async filetype({ request }: HttpContext) {
|
|
const payload = await request.validateUsing(downloadJobsByFiletypeSchema)
|
|
return this.downloadService.listDownloadJobs(payload.params.filetype)
|
|
}
|
|
}
|