Remove "before" field from Response
Listing responses only ever contain a non-empty "before" field when the "count" parameter is provided, which is only useful for the HTML website, not really needed for API clients Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
+1
-8
@@ -42,25 +42,19 @@ type inboxThing struct {
|
||||
|
||||
type inboxListing struct {
|
||||
inboxThings
|
||||
after string
|
||||
before string
|
||||
after string
|
||||
}
|
||||
|
||||
func (l *inboxListing) After() string {
|
||||
return l.after
|
||||
}
|
||||
|
||||
func (l *inboxListing) Before() string {
|
||||
return l.before
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (l *inboxListing) UnmarshalJSON(b []byte) error {
|
||||
root := new(struct {
|
||||
Data struct {
|
||||
Things inboxThings `json:"children"`
|
||||
After string `json:"after"`
|
||||
Before string `json:"before"`
|
||||
} `json:"data"`
|
||||
})
|
||||
|
||||
@@ -71,7 +65,6 @@ func (l *inboxListing) UnmarshalJSON(b []byte) error {
|
||||
|
||||
l.inboxThings = root.Data.Things
|
||||
l.after = root.Data.After
|
||||
l.before = root.Data.Before
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user