fix: TypeScript null check for RAG internal controller
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 55s

This commit is contained in:
WangDL 2026-05-19 22:36:18 +08:00
parent fbdae9078f
commit a0fafd0452

View File

@ -37,13 +37,11 @@ export class InternalRagController {
@Get('jobs/:id') @Get('jobs/:id')
async getJobDetail(@Param('id') id: string) { async getJobDetail(@Param('id') id: string) {
const job = await this.importRepo.findById(id); const job = await this.importRepo.findById(id);
if (!job) return { job: null }; if (!job) return { job: null, source: null };
let source = null; const source = job.sourceId
let downloadUrl = null; ? await this.sourceRepo.findById(job.sourceId)
if (job.sourceId) { : null;
source = await this.sourceRepo.findById(job.sourceId);
}
return { return {
job: { job: {