Add 'mark thread as done' functionality#3265
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3265 +/- ##
==========================================
- Coverage 97.72% 92.94% -4.78%
==========================================
Files 153 171 +18
Lines 13390 11669 -1721
==========================================
- Hits 13085 10846 -2239
- Misses 215 729 +514
- Partials 90 94 +4 ☔ View full report in Codecov by Sentry. |
| // GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done | ||
| // | ||
| //meta:operation DELETE /notifications/threads/{thread_id} | ||
| func (s *ActivityService) MarkThreadDone(ctx context.Context, id string) (*Response, error) { |
There was a problem hiding this comment.
According to this: https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28#mark-a-thread-as-done
id is an integer, so let's please change this:
| func (s *ActivityService) MarkThreadDone(ctx context.Context, id string) (*Response, error) { | |
| func (s *ActivityService) MarkThreadDone(ctx context.Context, id int64) (*Response, error) { |
There was a problem hiding this comment.
Sounds good to me, I'll update the PR. The MarkThreadRead function (which I shamelessly copied from) has the same issue, would you like me to fix it as part of this PR, or put in a separate PR to keep things clean?
There was a problem hiding this comment.
Yes, a separate PR would be great since that will be a breaking change. Thank you!
| }) | ||
|
|
||
| ctx := context.Background() | ||
| _, err := client.Activity.MarkThreadDone(ctx, "1") |
There was a problem hiding this comment.
These strings will need to be changed to int64 for tests to pass.
There was a problem hiding this comment.
Whops, fixed and tests pass locally now.
|
Thank you, @tomfeigin! |
Fixes #3264.