Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit7e51845

Browse files
committed
add hypermedia to summaries, show commit vs issue summary
1 parent7b0761f commit7e51845

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

‎content/v3/activity/notifications.md‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ time. The time should be passed in as UTC in the ISO 8601 format:
4949
###Response
5050

5151
<%= headers 200 %>
52-
<%= json(:summary) { |h|[h] } %>
52+
<%= json(:summaries) %>
5353

5454
##List your notifications in a repository
5555

@@ -69,7 +69,7 @@ directly participating or mentioned.
6969
###Response
7070

7171
<%= headers 200 %>
72-
<%= json(:summary) { |h|[h] } %>
72+
<%= json(:summaries) %>
7373

7474
##Mark as read
7575

@@ -97,10 +97,15 @@ from the [default view on GitHub.com](https://github.com/notifications).
9797

9898
GET /notifications/summaries/:id
9999

100-
###Response
100+
###Issue Summary Response
101+
102+
<%= headers 200 %>
103+
<%= json(:issue_summary) { |h|[h] } %>
104+
105+
###Commit Summary Response
101106

102107
<%= headers 200 %>
103-
<%= json(:summary) { |h|[h] } %>
108+
<%= json(:commit_summary) { |h|[h] } %>
104109

105110
##Mark a summary as read
106111

‎lib/resources.rb‎

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -961,29 +961,49 @@ def text_html(response, status, head = {})
961961
:size=>100
962962
}
963963

964-
SUMMARY={
964+
ISSUE_SUMMARY={
965965
:id=>1,
966966
:repository=>SIMPLE_REPO,
967967
:thread=>{
968968
:type=>"Issue",
969969
:id=>123,
970970
:title=>"Greetings",
971971
:state=>'open',
972-
:number=>123
972+
:number=>123,
973+
:url=>"https://api.github.com/repos/pengwynn/octokit/issues/123"
973974
},
974975
:comment=>{
975976
:type=>"IssueComment",
976-
:id=>123,
977+
:id=>456,
977978
:body=>"Hello",
978-
:user=>USER,
979+
:author=>USER,
979980
:created_at=>'2012-09-25T07:54:41-07:00',
981+
:url=>"https://api.github.com/repos/pengwynn/octokit/issues/comments/456"
980982
},
981983
:reason=>'subscribed',
982984
:unread=>true,
983985
:updated_at=>'2012-09-25T07:54:41-07:00',
984986
:last_read_at=>'2012-09-25T07:54:41-07:00'
985987
}
986988

989+
COMMIT_SUMMARY=ISSUE_SUMMARY.merge \
990+
:thread=>{
991+
:type=>"Commit",
992+
:title=>"added readme, because im a good github citizen",
993+
:id=>"7638417db6d59f3c431d3e1f261cc637155684cd",
994+
:url=>"https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd"
995+
},
996+
:comment=>{
997+
:type=>"CommitComment",
998+
:id=>1,
999+
:author=>USER,
1000+
:body=>"Great stuff",
1001+
:created_at=>'2012-09-25T07:54:41-07:00',
1002+
:url=>"https://api.github.com/repos/octocat/Hello-World/comments/1"
1003+
}
1004+
1005+
SUMMARIES=[ISSUE_SUMMARY,COMMIT_SUMMARY]
1006+
9871007
SUBSCRIPTION={
9881008
:subscribed=>true,
9891009
:ignored=>false,
@@ -993,4 +1013,3 @@ def text_html(response, status, head = {})
9931013
end
9941014
end
9951015

996-
includeGitHub::Resources::Helpers

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp