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')
async getJobDetail(@Param('id') id: string) {
const job = await this.importRepo.findById(id);
if (!job) return { job: null };
if (!job) return { job: null, source: null };
let source = null;
let downloadUrl = null;
if (job.sourceId) {
source = await this.sourceRepo.findById(job.sourceId);
}
const source = job.sourceId
? await this.sourceRepo.findById(job.sourceId)
: null;
return {
job: {