mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 11:39:26 +01:00
Failed download jobs persist in BullMQ forever with no way to clear them, leaving stale error notifications in Content Explorer and Easy Setup. Adds a dismiss button (X) on failed download cards that removes the job from the queue via a new DELETE endpoint. - Backend: DELETE /api/downloads/jobs/:jobId endpoint - Frontend: X button on failed download cards with immediate refresh Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
24 lines
755 B
TypeScript
24 lines
755 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)
|
|
}
|
|
|
|
async removeJob({ params }: HttpContext) {
|
|
await this.downloadService.removeFailedJob(params.jobId)
|
|
return { success: true }
|
|
}
|
|
}
|