Add methods to report, un/ignore reports

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-08-20 16:25:23 -04:00
parent f86a559d76
commit b89df0b64f
5 changed files with 128 additions and 0 deletions
+30
View File
@@ -180,3 +180,33 @@ func (s *ModerationService) Edited(ctx context.Context, subreddit string, opts *
return root.getPosts(), root.getComments(), resp, nil
}
// IgnoreReports prevents reports on a post or comment from causing notifications.
func (s *ModerationService) IgnoreReports(ctx context.Context, id string) (*Response, error) {
path := "api/ignore_reports"
form := url.Values{}
form.Set("id", id)
req, err := s.client.NewRequestWithForm(http.MethodPost, path, form)
if err != nil {
return nil, err
}
return s.client.Do(ctx, req, nil)
}
// UnignoreReports allows reports on a post or comment to cause notifications.
func (s *ModerationService) UnignoreReports(ctx context.Context, id string) (*Response, error) {
path := "api/unignore_reports"
form := url.Values{}
form.Set("id", id)
req, err := s.client.NewRequestWithForm(http.MethodPost, path, form)
if err != nil {
return nil, err
}
return s.client.Do(ctx, req, nil)
}