fix: TypeScript null check for RAG internal controller
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 55s
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 55s
This commit is contained in:
parent
fbdae9078f
commit
a0fafd0452
@ -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: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user