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
-6
@@ -127,7 +127,6 @@ type wikiPageRevisionListing struct {
|
||||
Data struct {
|
||||
Revisions []*WikiPageRevision `json:"children"`
|
||||
After string `json:"after"`
|
||||
Before string `json:"before"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
@@ -135,10 +134,6 @@ func (l *wikiPageRevisionListing) After() string {
|
||||
return l.Data.After
|
||||
}
|
||||
|
||||
func (l *wikiPageRevisionListing) Before() string {
|
||||
return l.Data.Before
|
||||
}
|
||||
|
||||
// WikiPageRevision is a revision of a wiki page.
|
||||
type WikiPageRevision struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
@@ -329,7 +324,7 @@ func (s *WikiService) revisions(ctx context.Context, subreddit, page string, opt
|
||||
}
|
||||
|
||||
if opts != nil {
|
||||
idPrefix := "WikiRevision_"
|
||||
const idPrefix = "WikiRevision_"
|
||||
if opts.After != "" && !strings.HasPrefix(opts.After, idPrefix) {
|
||||
opts.After = idPrefix + opts.After
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user