-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API: handle reactions to comments #8313
Comments
GitHub docu https://developer.github.com/v3/issues/comments/#reactions-summary |
This comment has been minimized.
This comment has been minimized.
Is better: more concise, no ids exposed. |
I agree with @guillep2k, that is the right way to do it. 👍 |
PUT / DELETE use as body {
"reaction": "heart",
"users": [ "6543" ]
} I could make it eaven mor simpler by just allow a "reaction": "heart" but i leave it open so admins have an API to send ractions for other users/bots... too |
Don't forget Sudo allows an admin to act like any other user - so you should only add that if you're going to allow the admin to set multiple user's reactions. |
imho we should follow GitHub API compatibility: Link above is just reaction counts by type in issue details API |
@lafriks @techknowlogick one downside: consider a issue with 15 comments -> each had ~ 10 reactions I'm thinking about mobile conection ... @lafriks add more fields beside the user{} can be usefull but should i expose the reaction ID (-> @guillep2k)? |
proposal2
[
{
"user": "octocat",
"content": "heart",
"created_at": "2016-05-20T20:09:31Z"
},
{
"user": "6543",
"content": "heart",
"created_at": "2017-10-20T20:09:31Z"
}
]
content: "heart" return: [
{
"user": "octocat",
"content": "heart",
"created_at": "2016-05-20T20:09:31Z"
}
] |
I don't agree as most probably you will still want to have user avatar url, user url, we do return this format in all other api, so I would not like this to be different. Reaction summary (counts by type) you will already have them in issue/pr/comment API. These are details so you really need to request them rarely - when you really want to know exact details |
@lafriks a this is same at |
so add a "reactions_light" or so type wich has smal foodprint to ⬆️ API endpoints? and make |
@lafriks github has a similar aproach: https://developer.github.com/v3/issues/#reactions-summary |
one thing wich is not goog at this reaction_summary_api: |
Proposal.3reaction endpoint
[
{
"id": 1,
"user": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"url": "https://api.github.com/users/octocat",
..... (gitea_api_user)
"type": "User",
"site_admin": false
},
"content": "heart",
"created_at": "2016-05-20T20:09:31Z"
}
]
content: "heart" return: Extend issue/pr/comment APIadd a reaction field: (api.reaction_summary) "reactions": [
{
"reaction": "heart",
"users": [ "6543" ],
"count": 1
},
{
"reaction": "rocket",
"users": [ "octa" ],
"count": 1
}
],
"reactions_count": 2,
"reactions_url": "/repos/{owner}/{repo}/<issues/comments/pull ...>/{id}/reactions" |
Extend issue/pr/comment APIGithub API for this is better imho "reactions": {
"total_count": 5,
"+1": 3,
"-1": 1,
"laugh": 0,
"confused": 0,
"heart": 1,
"hooray": 0,
"url": "{owner}/{repo}/issues/comments/{id}/reactions"
} |
@lafriks what if i like to add "rocket" 🚀? |
I'll do it the github way, but don't blame me for limitating api afterwards ... |
Gitea Reactions Summary"reactions_summary": [
{
"reaction": "heart",
"users": [ "6543" ],
"count": 1
},
{
"reaction": "rocket",
"users": [ "octa" ],
"count": 1
}
],
"reactions_counter": 2, EDIT: wont imlement jet - only if somebody need this, if so comment on this issue :D |
The text was updated successfully, but these errors were encountered: