diff options
author | Frédéric Guillot <fred@miniflux.net> | 2018-10-07 18:42:43 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2018-10-08 15:31:58 -0700 |
commit | 1f58b37a5e86603b16e137031c36f37580e9d410 (patch) | |
tree | 337a7299e91fe7640b64489357dfe7c0f00e2313 /api/subscription.go | |
parent | ddfe969d6cbc8d23326cb9a3ca9a265d4e9d3e45 (diff) |
Refactor HTTP response builder
Diffstat (limited to 'api/subscription.go')
-rw-r--r-- | api/subscription.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/api/subscription.go b/api/subscription.go index ff4c7cf..701759d 100644 --- a/api/subscription.go +++ b/api/subscription.go @@ -5,7 +5,6 @@ package api // import "miniflux.app/api" import ( - "fmt" "net/http" "miniflux.app/http/response/json" @@ -16,7 +15,7 @@ import ( func (c *Controller) GetSubscriptions(w http.ResponseWriter, r *http.Request) { subscriptionInfo, err := decodeURLPayload(r.Body) if err != nil { - json.BadRequest(w, err) + json.BadRequest(w, r, err) return } @@ -27,12 +26,12 @@ func (c *Controller) GetSubscriptions(w http.ResponseWriter, r *http.Request) { subscriptionInfo.Password, ) if err != nil { - json.ServerError(w, err) + json.ServerError(w, r, err) return } if subscriptions == nil { - json.NotFound(w, fmt.Errorf("No subscription found")) + json.NotFound(w, r) return } |