Skip to content
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

Breakdown Positive Reactions in the API #6303

Closed
BenjaminPrice opened this issue Feb 26, 2020 · 12 comments
Closed

Breakdown Positive Reactions in the API #6303

BenjaminPrice opened this issue Feb 26, 2020 · 12 comments
Labels
area: API api or request related issues

Comments

@BenjaminPrice
Copy link

Is your feature request related to a problem? Please describe.

For building functionality into the Unofficial DEV Social Badge, it'd be nice to offer a breakdown of what the positive reactions are.

Describe the solution you'd like

Include the breakdown of the positive reactions in the articles API endpoints

Describe alternatives you've considered

Scraping. But, again, I don't want to go down that path.

@rhymes rhymes added the area: API api or request related issues label Feb 26, 2020
@rhymes
Copy link
Contributor

rhymes commented Feb 26, 2020

Thanks for the issue! We'll take your request into consideration and follow up if we decide to tackle this issue.

To our amazing contributors: issues labeled type: bug are always up for grabs, but for feature requests, please wait until we add a ready for dev before starting to work on it.

To claim an issue to work on, please leave a comment. If you've claimed the issue and need help, please ping @thepracticaldev/oss and we will follow up within 3 business days.

For full info on how to contribute, please check out our contributors guide.

@lucasqueiroz
Copy link

Hey @rhymes could you assign this one to me?
Also, I'm currently having some trouble logging in when using GitPod. Is there a default login user/password?
Thanks

@citizen428
Copy link
Contributor

citizen428 commented Oct 5, 2020

@lucasqueiroz I assigned you the issue. Re GitPod, you can sign in with your GitHub account (via OAuth).

@lucasqueiroz
Copy link

@lucasqueiroz I assigned you the issue. Re GitPod, you can sign in with your GitHub account (via OAuth).

I tried logging in with GitHub but it redirects me to a 404 page. Do I have to update any environment variable to be able to log in?

Thanks

@citizen428
Copy link
Contributor

I tried logging in with GitHub but it redirects me to a 404 page.

Sorry, what exactly redirects you to a 404 page? Gitpod itself or the Forem app running inside Gitpod? To set up the Forem app for Github login, please follow the guide from our docs:

https://docs.dev.to/backend/auth-github/

@lucasqueiroz
Copy link

I tried logging in with GitHub but it redirects me to a 404 page.

Sorry, what exactly redirects you to a 404 page? Gitpod itself or the Forem app running inside Gitpod? To set up the Forem app for Github login, please follow the guide from our docs:

https://docs.dev.to/backend/auth-github/

Thanks, somehow I missed that doc page

@lucasqueiroz
Copy link

I finally got it to work locally and was able to change some things on the API to test it out. Do you guys have any idea on how it should be displayed?
I thought about something like this:

{
[...]
"public_reactions": {
  "count": 2,
  "reactions": {
    "0": {
      "user": {
        "name": "Lucas Queiroz",
        [...]
      },
      "category": "like"
    },
    [...]
  }
}

Or maybe

"public_reactions": {
  "count": 2,
  "reactions": {
    "like": {
      "user": {
        "name": "Lucas Queiroz",
        [...]
      },
    },
    "unicorn": [...],
    [...]
  }
}

What do you think?

@citizen428
Copy link
Contributor

citizen428 commented Oct 13, 2020

I think I'd go with number 1, but have reactions as an array instead of a hash with index keys (which is sort of like an array).

@lucasqueiroz
Copy link

I think I'd go with number 1, but have reactions as an array instead of a hash with index keys (which is sort of like an array).

So something like

{
  [...]
  "reactions": [
    {
      "user": {
        "name": "Lucas Queiroz",
        [...]
      },
      "category": "like"
    },
    [...]
  ]
}

?

I think this is a good approach. I'll start this way, let me know if there's a better way to use it.

Thanks

@BenjaminPrice
Copy link
Author

How about something like this:

"public_reactions": {
    "count": 12,
    "reactions": {
        "like": {
            "count": 5
            "users": [
                {
                    "name": "Lucas Queiroz",
                    [...]
                }
            ],
        },
        "unicorn": [...],
        [...]
    }
}

The advantage of this is you get the total count of reactions and the count by each reaction type without having to do any additional work on the consumer side. Then you can later add filtering on the API calls to decide whether or not to even return the users and other data points or just the counts.

@cmgorton cmgorton removed the external contributors welcome contribution is welcome! label Feb 2, 2021
@cmgorton
Copy link
Contributor

cmgorton commented Feb 2, 2021

Hey @lucasqueiroz Thanks so much for you work on this issue so far. We recently implemented a new internal RFC process for feature requests. With this new process we are figuring out when a Forem team member or an outside contributor should work on a feature request.

Given this process I am going to unassign you from this issue for now.
In the meantime if you see any bugs you want to squash let me know and we can assign them to you!

@cmgorton
Copy link
Contributor

Thanks again for this request. Since this one has been around a while without much traction I am going to close it here.
The Forem core team now uses an internal RFC ("request for comments") process to assess and prioritize new features. This process is intended to provide a consistent and standardized path for new changes to enter the Forem ecosystem. If you'd like to propose a new feature like this one, please visit forem.dev to start a discussion around it! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API api or request related issues
Projects
None yet
Development

No branches or pull requests

6 participants