Skip to content

Commit

Permalink
refactor job api GET
Browse files Browse the repository at this point in the history
  • Loading branch information
sotojn committed Oct 17, 2024
1 parent 298052e commit b39e86f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/teraslice/src/lib/cluster/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@ export class ApiService {
});

v1routes.get('/jobs/:jobId', (req, res) => {
const includeEx = req.query.ex;
const { ex } = req.query;
const { jobId } = req.params;
// @ts-expect-error
const requestHandler = handleTerasliceRequest(req as TerasliceRequest, res, 'Could not retrieve job');
typeof includeEx === 'string'
? requestHandler(async () => this.jobsService.getJobWithExInfo(jobId, includeEx.split(',')))
typeof ex === 'string'
? requestHandler(async () => this.jobsService.getJobWithExInfo(jobId, ex.split(',')))
: requestHandler(async () => this.jobsStorage.get(jobId));
});

Expand Down

0 comments on commit b39e86f

Please sign in to comment.