Update README.md, remove one of the flair methods
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
@@ -16,14 +16,6 @@ type FlairService struct {
|
||||
|
||||
// Flair is a flair on Reddit
|
||||
type Flair struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
Text string `json:"text,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
CSS string `json:"css_class,omitempty"`
|
||||
}
|
||||
|
||||
// FlairV2 is a flair on Reddit
|
||||
type FlairV2 struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
Text string `json:"text,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
@@ -33,7 +25,7 @@ type FlairV2 struct {
|
||||
|
||||
// GetFromSubreddit returns the flairs from the subreddit
|
||||
func (s *FlairService) GetFromSubreddit(ctx context.Context, name string) ([]Flair, *Response, error) {
|
||||
path := fmt.Sprintf("r/%s/api/user_flair", name)
|
||||
path := fmt.Sprintf("r/%s/api/user_flair_v2", name)
|
||||
|
||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
||||
if err != nil {
|
||||
@@ -48,21 +40,3 @@ func (s *FlairService) GetFromSubreddit(ctx context.Context, name string) ([]Fla
|
||||
|
||||
return flairs, resp, nil
|
||||
}
|
||||
|
||||
// GetFromSubredditV2 returns the flairs from the subreddit
|
||||
func (s *FlairService) GetFromSubredditV2(ctx context.Context, name string) ([]FlairV2, *Response, error) {
|
||||
path := fmt.Sprintf("r/%s/api/user_flair_v2", name)
|
||||
|
||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
var flairs []FlairV2
|
||||
resp, err := s.client.Do(ctx, req, &flairs)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return flairs, resp, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user