@@ -9,37 +9,53 @@ async function checkJobName(ctx, next) {
99 return next ( ) ;
1010}
1111
12- async function start ( ctx ) {
12+ async function addJobNameToQuery ( ctx , next ) {
13+ const { jobName } = ctx . params ;
14+
15+ ctx . query = { name : jobName } ;
16+
17+ return next ( ) ;
18+ }
19+
20+ async function start ( ctx , next ) {
1321 const { jobName } = ctx . params ;
1422
1523 await ctx . bree . start ( jobName ) ;
1624
1725 ctx . body = { } ;
26+
27+ return next ( ) ;
1828}
1929
20- async function stop ( ctx ) {
30+ async function stop ( ctx , next ) {
2131 const { jobName } = ctx . params ;
2232
2333 await ctx . bree . stop ( jobName ) ;
2434
2535 ctx . body = { } ;
36+
37+ return next ( ) ;
2638}
2739
28- async function run ( ctx ) {
40+ async function run ( ctx , next ) {
2941 const { jobName } = ctx . params ;
3042
3143 await ctx . bree . run ( jobName ) ;
3244
3345 ctx . body = { } ;
46+
47+ return next ( ) ;
3448}
3549
36- async function restart ( ctx ) {
50+ async function restart ( ctx , next ) {
3751 const { jobName } = ctx . params ;
3852
3953 await ctx . bree . stop ( jobName ) ;
4054 await ctx . bree . start ( jobName ) ;
4155
4256 ctx . body = { } ;
57+
58+ return next ( ) ;
4359}
4460
45- module . exports = { checkJobName, start, stop, run, restart } ;
61+ module . exports = { checkJobName, addJobNameToQuery , start, stop, run, restart } ;
0 commit comments