summaryrefslogtreecommitdiffstats
path: root/api4/job.go
diff options
context:
space:
mode:
Diffstat (limited to 'api4/job.go')
-rw-r--r--api4/job.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/api4/job.go b/api4/job.go
index 42cbdd3f7..57c604361 100644
--- a/api4/job.go
+++ b/api4/job.go
@@ -11,14 +11,14 @@ import (
"github.com/mattermost/mattermost-server/model"
)
-func InitJob() {
+func (api *API) InitJob() {
l4g.Info("Initializing job API routes")
- BaseRoutes.Jobs.Handle("", ApiSessionRequired(getJobs)).Methods("GET")
- BaseRoutes.Jobs.Handle("", ApiSessionRequired(createJob)).Methods("POST")
- BaseRoutes.Jobs.Handle("/{job_id:[A-Za-z0-9]+}", ApiSessionRequired(getJob)).Methods("GET")
- BaseRoutes.Jobs.Handle("/{job_id:[A-Za-z0-9]+}/cancel", ApiSessionRequired(cancelJob)).Methods("POST")
- BaseRoutes.Jobs.Handle("/type/{job_type:[A-Za-z0-9_-]+}", ApiSessionRequired(getJobsByType)).Methods("GET")
+ api.BaseRoutes.Jobs.Handle("", api.ApiSessionRequired(getJobs)).Methods("GET")
+ api.BaseRoutes.Jobs.Handle("", api.ApiSessionRequired(createJob)).Methods("POST")
+ api.BaseRoutes.Jobs.Handle("/{job_id:[A-Za-z0-9]+}", api.ApiSessionRequired(getJob)).Methods("GET")
+ api.BaseRoutes.Jobs.Handle("/{job_id:[A-Za-z0-9]+}/cancel", api.ApiSessionRequired(cancelJob)).Methods("POST")
+ api.BaseRoutes.Jobs.Handle("/type/{job_type:[A-Za-z0-9_-]+}", api.ApiSessionRequired(getJobsByType)).Methods("GET")
}
func getJob(c *Context, w http.ResponseWriter, r *http.Request) {