Remove duplicate code
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
parent
7bb73ddc6e
commit
f1b0d39a66
3 changed files with 32 additions and 247 deletions
|
@ -155,31 +155,16 @@ func (s *SubredditTrafficStats) UnmarshalJSON(b []byte) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: interface{}, seriously?
|
|
||||||
func (s *SubredditService) getPosts(ctx context.Context, sort string, subreddit string, opts interface{}) ([]*Post, *Response, error) {
|
func (s *SubredditService) getPosts(ctx context.Context, sort string, subreddit string, opts interface{}) ([]*Post, *Response, error) {
|
||||||
path := sort
|
path := sort
|
||||||
if subreddit != "" {
|
if subreddit != "" {
|
||||||
path = fmt.Sprintf("r/%s/%s", subreddit, sort)
|
path = fmt.Sprintf("r/%s/%s", subreddit, sort)
|
||||||
}
|
}
|
||||||
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
path, err := addOptions(path, opts)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Posts(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Posts(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// HotPosts returns the hottest posts from the specified subreddit.
|
// HotPosts returns the hottest posts from the specified subreddit.
|
||||||
|
@ -374,34 +359,12 @@ func (s *SubredditService) Unfavorite(ctx context.Context, subreddit string) (*R
|
||||||
|
|
||||||
// Search for subreddits.
|
// Search for subreddits.
|
||||||
func (s *SubredditService) Search(ctx context.Context, query string, opts *ListSubredditOptions) ([]*Subreddit, *Response, error) {
|
func (s *SubredditService) Search(ctx context.Context, query string, opts *ListSubredditOptions) ([]*Subreddit, *Response, error) {
|
||||||
path := "subreddits/search"
|
path := fmt.Sprintf("subreddits/search?q=%s", query)
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
params := struct {
|
|
||||||
Query string `url:"q"`
|
|
||||||
}{query}
|
|
||||||
|
|
||||||
path, err = addOptions(path, params)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Subreddits(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Subreddits(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SearchNames searches for subreddits with names beginning with the query provided.
|
// SearchNames searches for subreddits with names beginning with the query provided.
|
||||||
|
@ -464,24 +427,11 @@ func (s *SubredditService) SearchPosts(ctx context.Context, query string, subred
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SubredditService) getSubreddits(ctx context.Context, path string, opts *ListSubredditOptions) ([]*Subreddit, *Response, error) {
|
func (s *SubredditService) getSubreddits(ctx context.Context, path string, opts *ListSubredditOptions) ([]*Subreddit, *Response, error) {
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Subreddits(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Subreddits(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// getSticky returns one of the 2 stickied posts of the subreddit (if they exist).
|
// getSticky returns one of the 2 stickied posts of the subreddit (if they exist).
|
||||||
|
|
198
reddit/user.go
198
reddit/user.go
|
@ -137,24 +137,11 @@ func (s *UserService) Overview(ctx context.Context, opts *ListUserOverviewOption
|
||||||
// OverviewOf returns a list of the user's posts and comments.
|
// OverviewOf returns a list of the user's posts and comments.
|
||||||
func (s *UserService) OverviewOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Post, []*Comment, *Response, error) {
|
func (s *UserService) OverviewOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Post, []*Comment, *Response, error) {
|
||||||
path := fmt.Sprintf("user/%s/overview", username)
|
path := fmt.Sprintf("user/%s/overview", username)
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, resp, err
|
return nil, nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Posts(), l.Comments(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Posts(), listing.Comments(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Posts returns a list of your posts.
|
// Posts returns a list of your posts.
|
||||||
|
@ -165,24 +152,11 @@ func (s *UserService) Posts(ctx context.Context, opts *ListUserOverviewOptions)
|
||||||
// PostsOf returns a list of the user's posts.
|
// PostsOf returns a list of the user's posts.
|
||||||
func (s *UserService) PostsOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Post, *Response, error) {
|
func (s *UserService) PostsOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Post, *Response, error) {
|
||||||
path := fmt.Sprintf("user/%s/submitted", username)
|
path := fmt.Sprintf("user/%s/submitted", username)
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Posts(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Posts(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comments returns a list of your comments.
|
// Comments returns a list of your comments.
|
||||||
|
@ -193,47 +167,21 @@ func (s *UserService) Comments(ctx context.Context, opts *ListUserOverviewOption
|
||||||
// CommentsOf returns a list of the user's comments.
|
// CommentsOf returns a list of the user's comments.
|
||||||
func (s *UserService) CommentsOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Comment, *Response, error) {
|
func (s *UserService) CommentsOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Comment, *Response, error) {
|
||||||
path := fmt.Sprintf("user/%s/comments", username)
|
path := fmt.Sprintf("user/%s/comments", username)
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Comments(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Comments(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Saved returns a list of the user's saved posts and comments.
|
// Saved returns a list of the user's saved posts and comments.
|
||||||
func (s *UserService) Saved(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, []*Comment, *Response, error) {
|
func (s *UserService) Saved(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, []*Comment, *Response, error) {
|
||||||
path := fmt.Sprintf("user/%s/saved", s.client.Username)
|
path := fmt.Sprintf("user/%s/saved", s.client.Username)
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, resp, err
|
return nil, nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Posts(), l.Comments(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Posts(), listing.Comments(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upvoted returns a list of your upvoted posts.
|
// Upvoted returns a list of your upvoted posts.
|
||||||
|
@ -245,24 +193,11 @@ func (s *UserService) Upvoted(ctx context.Context, opts *ListUserOverviewOptions
|
||||||
// The user's votes must be public for this to work (unless the user is you).
|
// The user's votes must be public for this to work (unless the user is you).
|
||||||
func (s *UserService) UpvotedOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Post, *Response, error) {
|
func (s *UserService) UpvotedOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Post, *Response, error) {
|
||||||
path := fmt.Sprintf("user/%s/upvoted", username)
|
path := fmt.Sprintf("user/%s/upvoted", username)
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Posts(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Posts(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Downvoted returns a list of your downvoted posts.
|
// Downvoted returns a list of your downvoted posts.
|
||||||
|
@ -274,70 +209,31 @@ func (s *UserService) Downvoted(ctx context.Context, opts *ListUserOverviewOptio
|
||||||
// The user's votes must be public for this to work (unless the user is you).
|
// The user's votes must be public for this to work (unless the user is you).
|
||||||
func (s *UserService) DownvotedOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Post, *Response, error) {
|
func (s *UserService) DownvotedOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Post, *Response, error) {
|
||||||
path := fmt.Sprintf("user/%s/downvoted", username)
|
path := fmt.Sprintf("user/%s/downvoted", username)
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Posts(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Posts(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hidden returns a list of the user's hidden posts.
|
// Hidden returns a list of the user's hidden posts.
|
||||||
func (s *UserService) Hidden(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, *Response, error) {
|
func (s *UserService) Hidden(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, *Response, error) {
|
||||||
path := fmt.Sprintf("user/%s/hidden", s.client.Username)
|
path := fmt.Sprintf("user/%s/hidden", s.client.Username)
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Posts(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Posts(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gilded returns a list of the user's gilded posts.
|
// Gilded returns a list of the user's gilded posts.
|
||||||
func (s *UserService) Gilded(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, *Response, error) {
|
func (s *UserService) Gilded(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, *Response, error) {
|
||||||
path := fmt.Sprintf("user/%s/gilded", s.client.Username)
|
path := fmt.Sprintf("user/%s/gilded", s.client.Username)
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Posts(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Posts(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetFriendship returns relationship details with the specified user.
|
// GetFriendship returns relationship details with the specified user.
|
||||||
|
@ -503,78 +399,30 @@ func (s *UserService) TrophiesOf(ctx context.Context, username string) ([]*Troph
|
||||||
// Popular gets the user subreddits with the most activity.
|
// Popular gets the user subreddits with the most activity.
|
||||||
func (s *UserService) Popular(ctx context.Context, opts *ListOptions) ([]*Subreddit, *Response, error) {
|
func (s *UserService) Popular(ctx context.Context, opts *ListOptions) ([]*Subreddit, *Response, error) {
|
||||||
path := "users/popular"
|
path := "users/popular"
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Subreddits(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Subreddits(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// New gets the most recently created user subreddits.
|
// New gets the most recently created user subreddits.
|
||||||
func (s *UserService) New(ctx context.Context, opts *ListUserOverviewOptions) ([]*Subreddit, *Response, error) {
|
func (s *UserService) New(ctx context.Context, opts *ListUserOverviewOptions) ([]*Subreddit, *Response, error) {
|
||||||
path := "users/new"
|
path := "users/new"
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Subreddits(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Subreddits(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search for users.
|
// Search for users.
|
||||||
// todo: maybe include the sort option? (relevance, activity)
|
// todo: maybe include the sort option? (relevance, activity)
|
||||||
func (s *UserService) Search(ctx context.Context, query string, opts *ListOptions) ([]*User, *Response, error) {
|
func (s *UserService) Search(ctx context.Context, query string, opts *ListOptions) ([]*User, *Response, error) {
|
||||||
path := "users/search"
|
path := fmt.Sprintf("users/search?q=%s", query)
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
params := struct {
|
|
||||||
Query string `url:"q"`
|
|
||||||
}{query}
|
|
||||||
|
|
||||||
path, err = addOptions(path, params)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Users(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Users(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -317,24 +317,11 @@ func (s *WikiService) UpdateSettings(ctx context.Context, subreddit, page string
|
||||||
// Discussions gets a list of discussions (posts) about the wiki page.
|
// Discussions gets a list of discussions (posts) about the wiki page.
|
||||||
func (s *WikiService) Discussions(ctx context.Context, subreddit, page string, opts *ListOptions) ([]*Post, *Response, error) {
|
func (s *WikiService) Discussions(ctx context.Context, subreddit, page string, opts *ListOptions) ([]*Post, *Response, error) {
|
||||||
path := fmt.Sprintf("r/%s/wiki/discussions/%s", subreddit, page)
|
path := fmt.Sprintf("r/%s/wiki/discussions/%s", subreddit, page)
|
||||||
path, err := addOptions(path, opts)
|
l, resp, err := s.client.getListing(ctx, path, opts)
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
root := new(thing)
|
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
return l.Posts(), resp, nil
|
||||||
listing, _ := root.Listing()
|
|
||||||
return listing.Posts(), resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ToggleVisibility toggles the public visibility of a wiki page revision.
|
// ToggleVisibility toggles the public visibility of a wiki page revision.
|
||||||
|
|
Loading…
Reference in a new issue