1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-06 17:41:00 +00:00

Refactor category validation

This commit is contained in:
Frédéric Guillot 2021-01-03 22:28:04 -08:00 committed by fguillot
parent e45cc2d2aa
commit 4468ef1410
13 changed files with 122 additions and 212 deletions

View file

@ -182,19 +182,3 @@ func decodeEntryStatusRequest(r io.ReadCloser) ([]int64, string, error) {
return p.EntryIDs, p.Status, nil
}
type categoryRequest struct {
Title string `json:"title"`
}
func decodeCategoryRequest(r io.ReadCloser) (*categoryRequest, error) {
var payload categoryRequest
decoder := json.NewDecoder(r)
defer r.Close()
if err := decoder.Decode(&payload); err != nil {
return nil, fmt.Errorf("Unable to decode JSON object: %v", err)
}
return &payload, nil
}