From 7bcff2e9733194bc3ebd83cb141967a08a374d6b Mon Sep 17 00:00:00 2001 From: Jade McGough Date: Wed, 27 Mar 2019 14:31:04 -0700 Subject: [PATCH] =?UTF-8?q?fix(http):=20remove=20newPatchLabelHandler,=20i?= =?UTF-8?q?t=20should=20not=20exist=E2=80=A8=20This=20was=20removed=20in?= =?UTF-8?q?=20the=20labels=202.0=20rewrite,=20and=20looks=20like=20it=20wa?= =?UTF-8?q?s=20added=20back=20as=20a=20regression?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- http/bucket_service.go | 1 - http/dashboard_service.go | 1 - http/label_service.go | 24 ------------------------ http/org_service.go | 1 - http/task_service.go | 1 - http/telegraf.go | 1 - 6 files changed, 29 deletions(-) diff --git a/http/bucket_service.go b/http/bucket_service.go index 3b059f7389..460a3e53cf 100644 --- a/http/bucket_service.go +++ b/http/bucket_service.go @@ -120,7 +120,6 @@ func NewBucketHandler(b *BucketBackend) *BucketHandler { h.HandlerFunc("GET", bucketsIDLabelsPath, newGetLabelsHandler(labelBackend)) h.HandlerFunc("POST", bucketsIDLabelsPath, newPostLabelHandler(labelBackend)) h.HandlerFunc("DELETE", bucketsIDLabelsIDPath, newDeleteLabelHandler(labelBackend)) - h.HandlerFunc("PATCH", bucketsIDLabelsIDPath, newPatchLabelHandler(labelBackend)) return h } diff --git a/http/dashboard_service.go b/http/dashboard_service.go index f3633b6698..5655f4a07a 100644 --- a/http/dashboard_service.go +++ b/http/dashboard_service.go @@ -125,7 +125,6 @@ func NewDashboardHandler(b *DashboardBackend) *DashboardHandler { h.HandlerFunc("GET", dashboardsIDLabelsPath, newGetLabelsHandler(labelBackend)) h.HandlerFunc("POST", dashboardsIDLabelsPath, newPostLabelHandler(labelBackend)) h.HandlerFunc("DELETE", dashboardsIDLabelsIDPath, newDeleteLabelHandler(labelBackend)) - h.HandlerFunc("PATCH", dashboardsIDLabelsIDPath, newPatchLabelHandler(labelBackend)) return h } diff --git a/http/label_service.go b/http/label_service.go index b8ca6de56b..d087db564c 100644 --- a/http/label_service.go +++ b/http/label_service.go @@ -432,30 +432,6 @@ func decodePostLabelMappingRequest(ctx context.Context, r *http.Request, rt plat return req, nil } -// newPatchLabelHandler returns a handler func for a PATCH to /labels endpoints -func newPatchLabelHandler(b *LabelBackend) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() - - req, err := decodePatchLabelRequest(ctx, r) - if err != nil { - EncodeError(ctx, err, w) - return - } - - label, err := b.LabelService.UpdateLabel(ctx, req.LabelID, req.Update) - if err != nil { - EncodeError(ctx, err, w) - return - } - - if err := encodeResponse(ctx, w, http.StatusOK, newLabelResponse(label)); err != nil { - logEncodingError(b.Logger, r, err) - return - } - } -} - // newDeleteLabelHandler returns a handler func for a DELETE to /labels endpoints func newDeleteLabelHandler(b *LabelBackend) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { diff --git a/http/org_service.go b/http/org_service.go index 46455f46e2..9615590715 100644 --- a/http/org_service.go +++ b/http/org_service.go @@ -127,7 +127,6 @@ func NewOrgHandler(b *OrgBackend) *OrgHandler { h.HandlerFunc("GET", organizationsIDLabelsPath, newGetLabelsHandler(labelBackend)) h.HandlerFunc("POST", organizationsIDLabelsPath, newPostLabelHandler(labelBackend)) h.HandlerFunc("DELETE", organizationsIDLabelsIDPath, newDeleteLabelHandler(labelBackend)) - h.HandlerFunc("PATCH", organizationsIDLabelsIDPath, newPatchLabelHandler(labelBackend)) return h } diff --git a/http/task_service.go b/http/task_service.go index 2fd17ee14a..cedb13fa9f 100644 --- a/http/task_service.go +++ b/http/task_service.go @@ -145,7 +145,6 @@ func NewTaskHandler(b *TaskBackend) *TaskHandler { h.HandlerFunc("GET", tasksIDLabelsPath, newGetLabelsHandler(labelBackend)) h.HandlerFunc("POST", tasksIDLabelsPath, newPostLabelHandler(labelBackend)) h.HandlerFunc("DELETE", tasksIDLabelsIDPath, newDeleteLabelHandler(labelBackend)) - h.HandlerFunc("PATCH", tasksIDLabelsIDPath, newPatchLabelHandler(labelBackend)) return h } diff --git a/http/telegraf.go b/http/telegraf.go index fc5dafcc48..461152db7c 100644 --- a/http/telegraf.go +++ b/http/telegraf.go @@ -111,7 +111,6 @@ func NewTelegrafHandler(b *TelegrafBackend) *TelegrafHandler { h.HandlerFunc("GET", telegrafsIDLabelsPath, newGetLabelsHandler(labelBackend)) h.HandlerFunc("POST", telegrafsIDLabelsPath, newPostLabelHandler(labelBackend)) h.HandlerFunc("DELETE", telegrafsIDLabelsIDPath, newDeleteLabelHandler(labelBackend)) - h.HandlerFunc("PATCH", telegrafsIDLabelsIDPath, newPatchLabelHandler(labelBackend)) return h }