summaryrefslogtreecommitdiffstats
path: root/api4/job.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-09-22 12:54:27 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2017-09-22 13:54:27 -0400
commitdcf9e96a0b16530549168a7891ed8242663b5f28 (patch)
tree344255f0abbe1bd207e2f2ab864d245e240f4eeb /api4/job.go
parente0d5703f721aafef1b55747cd09629860e86bfb4 (diff)
downloadchat-dcf9e96a0b16530549168a7891ed8242663b5f28.tar.gz
chat-dcf9e96a0b16530549168a7891ed8242663b5f28.tar.bz2
chat-dcf9e96a0b16530549168a7891ed8242663b5f28.zip
remove global refs from api/api4 (#7496)
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) {