Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 46e06b5

Browse files
committed
Use PullRequest.timelineItems instead of timeline
1 parent ab1e2b1 commit 46e06b5

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

src/GitHub.InlineReviews/Services/PullRequestSessionService.cs

+20-21
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ public virtual Task<PullRequestDetailModel> ReadPullRequestDetail(HostAddress ad
306306
async Task<PullRequestDetailModel> ReadPullRequestDetailWithResolved(HostAddress address, string owner,
307307
string name, int number, bool refresh)
308308
{
309-
310309
if (readPullRequestWithResolved == null)
311310
{
312311
readPullRequestWithResolved = new Query()
@@ -384,22 +383,22 @@ async Task<PullRequestDetailModel> ReadPullRequestDetailWithResolved(HostAddress
384383
AvatarUrl = review.Author.AvatarUrl(null)
385384
}
386385
}).ToList(),
387-
Timeline = pr.Timeline(null, null, null, null, null).AllPages().Select(item => item.Switch<object>(when =>
388-
when.Commit(commit => new CommitModel
386+
Timeline = pr.TimelineItems(null, null, null, null, null, null, null).AllPages().Select(item => item.Switch<object>(when =>
387+
when.PullRequestCommit(commit => new CommitModel
389388
{
390-
AbbreviatedOid = commit.AbbreviatedOid,
389+
AbbreviatedOid = commit.Commit.AbbreviatedOid,
391390
Author = new CommitActorModel
392391
{
393-
Name = commit.Author.Name,
394-
Email = commit.Author.Email,
395-
User = commit.Author.User != null ? new ActorModel
392+
Name = commit.Commit.Author.Name,
393+
Email = commit.Commit.Author.Email,
394+
User = commit.Commit.Author.User != null ? new ActorModel
396395
{
397-
Login = commit.Author.User.Login,
398-
AvatarUrl = commit.Author.User.AvatarUrl(null),
396+
Login = commit.Commit.Author.User.Login,
397+
AvatarUrl = commit.Commit.Author.User.AvatarUrl(null),
399398
} : null
400399
},
401-
MessageHeadline = commit.MessageHeadline,
402-
Oid = commit.Oid,
400+
MessageHeadline = commit.Commit.MessageHeadline,
401+
Oid = commit.Commit.Oid,
403402
}).IssueComment(comment => new CommentModel
404403
{
405404
Author = new ActorModel
@@ -563,21 +562,21 @@ async Task<PullRequestDetailModel> ReadPullRequestDetailWithoutResolved(HostAddr
563562
Url = comment.Url,
564563
}).ToList(),
565564
}).ToList(),
566-
Timeline = pr.Timeline(null, null, null, null, null).AllPages().Select(item => item.Switch<object>(when =>
567-
when.Commit(commit => new CommitModel
565+
Timeline = pr.TimelineItems(null, null, null, null, null, null, null).AllPages().Select(item => item.Switch<object>(when =>
566+
when.PullRequestCommit(commit => new CommitModel
568567
{
569-
AbbreviatedOid = commit.AbbreviatedOid,
568+
AbbreviatedOid = commit.Commit.AbbreviatedOid,
570569
Author = new CommitActorModel {
571-
Name = commit.Author.Name,
572-
Email = commit.Author.Email,
573-
User = commit.Author.User != null ? new ActorModel
570+
Name = commit.Commit.Author.Name,
571+
Email = commit.Commit.Author.Email,
572+
User = commit.Commit.Author.User != null ? new ActorModel
574573
{
575-
Login = commit.Author.User.Login,
576-
AvatarUrl = commit.Author.User.AvatarUrl(null),
574+
Login = commit.Commit.Author.User.Login,
575+
AvatarUrl = commit.Commit.Author.User.AvatarUrl(null),
577576
} : null
578577
},
579-
MessageHeadline = commit.MessageHeadline,
580-
Oid = commit.Oid,
578+
MessageHeadline = commit.Commit.MessageHeadline,
579+
Oid = commit.Commit.Oid,
581580
}).IssueComment(comment => new CommentModel
582581
{
583582
Author = new ActorModel

0 commit comments

Comments
 (0)