diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/jobs.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/controllers/api/jobs.ts b/server/controllers/api/jobs.ts index 1fa662349..05320311e 100644 --- a/server/controllers/api/jobs.ts +++ b/server/controllers/api/jobs.ts | |||
@@ -24,7 +24,7 @@ jobsRouter.get('/:state', | |||
24 | jobsSortValidator, | 24 | jobsSortValidator, |
25 | setDefaultSort, | 25 | setDefaultSort, |
26 | setDefaultPagination, | 26 | setDefaultPagination, |
27 | asyncMiddleware(listJobsValidator), | 27 | listJobsValidator, |
28 | asyncMiddleware(listJobs) | 28 | asyncMiddleware(listJobs) |
29 | ) | 29 | ) |
30 | 30 | ||
@@ -39,8 +39,15 @@ export { | |||
39 | async function listJobs (req: express.Request, res: express.Response) { | 39 | async function listJobs (req: express.Request, res: express.Response) { |
40 | const state = req.params.state as JobState | 40 | const state = req.params.state as JobState |
41 | const asc = req.query.sort === 'createdAt' | 41 | const asc = req.query.sort === 'createdAt' |
42 | const jobType = req.query.jobType | ||
42 | 43 | ||
43 | const jobs = await JobQueue.Instance.listForApi(state, req.query.start, req.query.count, asc) | 44 | const jobs = await JobQueue.Instance.listForApi({ |
45 | state, | ||
46 | start: req.query.start, | ||
47 | count: req.query.count, | ||
48 | asc, | ||
49 | jobType | ||
50 | }) | ||
44 | const total = await JobQueue.Instance.count(state) | 51 | const total = await JobQueue.Instance.count(state) |
45 | 52 | ||
46 | const result: ResultList<any> = { | 53 | const result: ResultList<any> = { |