fixed Get on post service

This commit is contained in:
2026-02-15 21:40:10 -06:00
parent 0599835374
commit 76c46f0a0d
2 changed files with 17 additions and 7 deletions
+2 -2
View File
@@ -65,8 +65,8 @@ type SubmitLinkRequest struct {
// Get a post with its comments.
// id is the ID36 of the post, not its full id.
// Example: instead of t3_abc123, use abc123.
func (s *PostService) Get(ctx context.Context, id string) (*PostAndComments, *Response, error) {
path := fmt.Sprintf("comments/%s", id)
func (s *PostService) Get(ctx context.Context, id, subreddit string) (*PostAndComments, *Response, error) {
path := fmt.Sprintf("r/%s/comments/%s/", subreddit, id)
req, err := s.client.NewRequest(http.MethodGet, path, nil)
if err != nil {
return nil, nil, err