diff options
author | 2018-10-07 18:42:43 -0700 | |
---|---|---|
committer | 2018-10-08 15:31:58 -0700 | |
commit | 1f58b37a5e86603b16e137031c36f37580e9d410 (patch) | |
tree | 337a7299e91fe7640b64489357dfe7c0f00e2313 /ui/entry_update_status.go | |
parent | ddfe969d6cbc8d23326cb9a3ca9a265d4e9d3e45 (diff) | |
download | v2-1f58b37a5e86603b16e137031c36f37580e9d410.tar.gz v2-1f58b37a5e86603b16e137031c36f37580e9d410.tar.zst v2-1f58b37a5e86603b16e137031c36f37580e9d410.zip |
Refactor HTTP response builder
Diffstat (limited to 'ui/entry_update_status.go')
-rw-r--r-- | ui/entry_update_status.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ui/entry_update_status.go b/ui/entry_update_status.go index 8e9de4de..6c5cb127 100644 --- a/ui/entry_update_status.go +++ b/ui/entry_update_status.go @@ -10,27 +10,24 @@ import ( "miniflux.app/http/request" "miniflux.app/http/response/json" - "miniflux.app/logger" ) // UpdateEntriesStatus updates the status for a list of entries. func (c *Controller) UpdateEntriesStatus(w http.ResponseWriter, r *http.Request) { entryIDs, status, err := decodeEntryStatusPayload(r.Body) if err != nil { - logger.Error("[Controller:UpdateEntryStatus] %v", err) - json.BadRequest(w, nil) + json.BadRequest(w, r, err) return } if len(entryIDs) == 0 { - json.BadRequest(w, errors.New("The list of entryID is empty")) + json.BadRequest(w, r, errors.New("The list of entry IDs is empty")) return } err = c.store.SetEntriesStatus(request.UserID(r), entryIDs, status) if err != nil { - logger.Error("[Controller:UpdateEntryStatus] %v", err) - json.ServerError(w, nil) + json.ServerError(w, r, err) return } |